Load Balancers in PKS
Page last updated:
This topic describes the types of load balancers that are used in Pivotal Container Service (PKS) deployments. Load balancers differ by the type of deployment.
For PKS deployments on GCP or vSphere without NSX-T, you can configure load balancers for the following:
- PKS API: Configuring this load balancer allows you to run PKS Command Line Interface (CLI) commands from your local workstation.
- Kubernetes Clusters: Configuring a load balancer for each new cluster allows you to run Kubernetes CLI (kubectl) commands on the cluster.
- Workloads: Configuring a load balancer for your application workloads allows external access to the services that run on your cluster.
The following diagram shows where each of the above load balancers can be used within your PKS deployment on GCP or on vSphere without NSX-T:
If you use either vSphere without NSX-T or GCP, you are expected to create your own load balancers within your cloud provider console. If your cloud provider does not offer load balancing, you can use any external TCP or HTTPS load balancer of your choice.
For PKS deployments on GCP and on vSphere without NSX-T, the load balancer for the PKS API allows you to access the PKS API from outside the network. For example, configuring a load balancer for the PKS API allows you to run PKS CLI commands from your local workstation.
For information about configuring the PKS API load balancer, see the Configure External Load Balancer section of Installing PKS for your IaaS.
For PKS deployments on GCP and on vSphere without NSX-T, when you create a cluster, you must configure external access to the cluster by creating an external TCP or HTTPS load balancer. The load balancer allows the Kubernetes CLI to communicate with the cluster.
If you create a cluster in a non-production environment, you can choose not to use a load balancer. To allow kubectl to access the cluster without a load balancer, you can do one of the following:
- Create a DNS entry that points to the cluster’s master VM. For example:
my-cluster.example.com A 10.0.0.5
- On the workstation where you run kubectl commands, add the master IP address of your cluster and
/etc/hostsfile. For example:
For information about configuring a cluster load balancer, see Creating Clusters.
For PKS deployments on GCP and on vSphere without NSX-T, to allow external access to your app, you can either create a load balancer or expose a static port on your workload.
For information about configuring a load balancer for your app workload, see Deploying and Accessing Basic Workloads.
PKS deployments on vSphere with NSX-T do not require a load balancer configured to access the PKS API. They require only a DNAT rule configured so that the PKS API host is accessible. For more information, see Retrieve the PKS Endpoint in Installing PKS on vSphere with NSX-T Integration.
NSX-T handles load balancer creation, configuration, and deletion automatically as part of the Kubernetes cluster create, update, and delete process. When a new Kubernetes cluster is created, NSX-T creates and configures a dedicated load balancer tied to it. The load balancer is a shared resource designed to provide efficient traffic distribution to master nodes as well as services deployed on worker nodes. Each application service is mapped to a virtual server instance, carved out from the same load balancer. For more information, see Logical Load Balancer in the NSX-T documentation.
Virtual server instances are created on the load balancer to provide access to the following:
- Kubernetes API and UI services on a Kubernetes cluster. This allows requests to be load balanced across multiple master nodes.
- Ingress controller. This allows the virtual server instance to dispatch HTTP and HTTPS requests to services associated with Ingress rules.
type:loadbalancerservices. This allows the server to handle TCP connections or UDP flows toward exposed services.
Load balancers are deployed in high-availability mode so that they are resilient to potential failures and able to recover quickly from critical conditions.
NodePort Service type is not supported for PKS deployments on vSphere with NSX-T. Only
type:LoadBalancerServices and Services associated with Ingress rules are supported on vSphere with NSX-T.
When a new Kubernetes cluster is created using the PKS API, NSX-T creates a dedicated load balancer for that new cluster. By default, the size of the load balancer is set to Small in NSX Manager. A Small sized load balancer is limited to a maximum of 10 NSX-T virtual servers.
Note: Pivotal recommends changing the size of your NSX-T load balancer from Small to Medium in NSX Manager. Doing so increases your virtual server limit from 10 to 100.
Please send any feedback you have to firstname.lastname@example.org.