-1

I know about kubernetes service in that LoadBalancer service is an extention of NodePort and ClusterIP which is already a load balancer layer of pods. When we use NodePort or CluserIP and ingress we have had able to access application over domain with load balancer (internal) at Service. So why do we still have another option is LoadBalancer service (external cloud providers)?

vsudo
  • 1
  • 1
  • 1
    Does this answer your question? [Ingress vs Load Balancer](https://stackoverflow.com/questions/45079988/ingress-vs-load-balancer) – Lin Du Aug 11 '21 at 03:10

1 Answers1

1

On cloud providers which support external load balancers, setting the type field to LoadBalancer provisions a load balancer for your Service. The actual creation of the load balancer happens asynchronously, and information about the provisioned balancer is published in the Service's .status.loadBalancer field.

Traffic from the external load balancer is directed at the backend Pods. The cloud provider decides how it is load balanced.

Some cloud providers allow you to specify the loadBalancerIP. In those cases, the load-balancer is created with the user-specified loadBalancerIP. If the loadBalancerIP field is not specified, the loadBalancer is set up with an ephemeral IP address. If you specify a loadBalancerIP but your cloud provider does not support the feature, the loadbalancerIP field that you set is ignored.

Igress is a different concept where you will have a set of rules for path to route the traffic to the specific backend.

Chandra Sekar
  • 637
  • 4
  • 9
  • We could add that MetalLB implements LoadBalancer services provisioning when your cluster is not integrated with a cloud API. And to answer the original question: why? Because Ingress would only expose http-lookalike protocols, while LoadBalancer could expose any TCP or UDP endpoint. – SYN Aug 11 '21 at 06:07