4 ms·
I am not an K8S expert, but why is it that (most?) cloud load balancers not act as ingress controllers?
by renke1 6y ago
I am not an K8S expert, but why is it that (most?) cloud load balancers not act as ingress controllers?
- shane_siebken 6y agoI'd say that's primarily because those load balancers (assuming some like a Network Load Balancer in AWS for example) are not integrated in the k8s network stack. Cloud load balancers are absolutely an important part of delivering network traffic to your cluster, but the ingress controllers have to "know" a bit more about cluster network topology to serve the purpose they serve. That is, taking incoming traffic from node(s) at a common port and sending it on to a particular service in the cluster.
- renke1 6y agoI was thinking about AWS's Application Load Balancer which already has some kind of rules similar to ingress resources in K8S. I think the LB in Digital Ocean has something similar as well. Having to run (multiple) ingress controller instances in your cluster seems like a waste of resources. Also, if ingress controller specific functionality is used, are ingress resources even the right abstraction?
- p_l 6y agoAWS ALB is exposed as Ingress through alb-ingress-controller. NLB is exposed through Service objects which correspond to L4 load balancers (with Type=LoadBalancer set)
- mdaniel 6y agoIn addition to the great sibling comment, another reason is typically cost: if I had to provision a new cloud load balancer for every review environment in GitLab, that'd be quite pricy (and much, much slower to deploy)
- renke1 6y agoHow do you typically access your K8S cluster when it's not fronted by a LB and it has multiple nodes?
- withinboredom 6y agoYou can assign multiple ips to the same dns entry. It’s not quite as flexible as a load balancer, but sometimes that’s all you need.
- champtar 6y agoMetalLB in L2 or BGP mode
- tijsvd 6y agoAt least in AWS, it will by default instantiate an application LB for every ingress (so at least one per namespace). With an internal ingress controller, one can combine all ingresses into e.g. a single nginx service. That service can then be fronted by one single network LB for the whole cluster.
- DenseComet 6y agoOn a similar but unrelated note about load balancers, if I have a VM with multiple IPs, how can I bind a service to a single IP? It seems like a service using a NodePort listens on that port on all IPs, however, I haven't found a load balancer implementation that lets me do this either.
- p_l 6y agoOn the Service object side, the method is to set loadBalancerIP in the spec. The implementing side for Services has to then do the appropriate operations to either get you that IP, or fail creation of Service. On GCP, if you set loadBalancerIP to IP of a persistent, unattached public IP you own, it will automatically attach to it. I expect similar behaviour on AWS and others.
- q3k 6y agoGKE (K8s on GCP) does come with an ingress controller that is backed by GCP/GCE load balancers.
- linkdd 6y agoIngress resources are used to declare what is the expected input traffic of your cluster. How you route that traffic to your cluster is another problem.