Does a Loadbalancer need to be created from within Kubernets?

May 29, 2019 317 views
Kubernetes Load Balancing


When adding a Loadbalancer to a Kubernets cluster does it need to be added from a YAML file or can it be added from the Web UI? Any advantage to either way?

I notice that when I add it via YAML my droplets health checks don't work and doing kubectl -n Kube-system describe my-load-balancer shows different ports (that cannot be changed) than the Web UI.

1 Answer

For the Load Balancer to be used within the Cluster, it must be created through Kubernetes as an object. You can see examples for this here:

The DigitalOcean CCM ( ) handles the creation of the object within the cluster and the provisioning of the Load Balancer on your account.

The health checks are based on the pods identified under the selector spec of the service, so you will need to ensure that your service has endpoints to working pods that are placed on the different nodes in your cluster so the health checks can succeed and the load balancer will properly route requests to those services.

Have another answer? Share your knowledge.