Question

Does a Loadbalancer need to be created from within Kubernets?

Hi,

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.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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:

https://www.digitalocean.com/docs/kubernetes/how-to/add-load-balancers/ https://www.digitalocean.com/docs/kubernetes/how-to/configure-load-balancers/

The DigitalOcean CCM ( https://github.com/digitalocean/digitalocean-cloud-controller-manager/tree/master/docs/controllers/services/examples ) 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.