Report this

What is the reason for this report?

Does a Loadbalancer need to be created from within Kubernets?

Posted on May 29, 2019

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.



This textbox defaults to using Markdown to format your 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.