2
votes

Made my way into kubernetes through GKE, currently trying out via kubeadm on bare metal.

In the later environment, there is no need of any specific load balancer; using nginx-ingress and ingresses let one serve service to the www.

Oppositely, on gke, using the same nginx-ingress, or using the gke provided l7, you always end up with a billed load balancer.

What's the reason about that, as it seemed not to be ultimately needed ?

2
Hi, It seems you are getting confused at load balancing of layer 3,4 and 7. following article might give you insight about modern load-balancing and proxyingSuresh Vishnoi
Humm… Am skilled enough to use all but but frankly my brain cells aren't organized to understand the underlyings of those networking topics. I've read the article; I can understand the benefits of using an L7, but not the reason why such "add-on" is enforced on gkeBen
In general, when receiving traffic from the outside world, that traffic will be sent to one or more non-ACLd public IP addresses. If you run k8s on bare metals, those BMs can have public IPs, and you can just run ingress on one or more of them. A managed k8s environment, however, for security reasons, will not permit nodes to have public IPs. Instead, managed load balancers are allowed to have public IPs. Those are configured to know the private node IPs hosting ingress for your cluster and will direct traffic accordingly.Jonah Benton
Hello @Jonah B, your comment seems great to be posted as a complete answer. Please do.Fady
There is a way to skip the Load Balancer entirely, see serverfault.com/questions/863569/… Not recommended for serious production uses. Fine for poor-man solutions.Jonathan Lin

2 Answers

3
votes

(Reposting my comment above)

In general, when one is receiving traffic from the outside world, that traffic is being sent to one or more non-ACLd public IP addresses.

If you run k8s on bare metals, those BMs can have public IPs, and you can just run ingress on one or more of them.

A managed k8s environment, however, for security reasons, will not permit nodes to have public IPs.

Instead, managed load balancers are allowed to have public IPs. Those are configured to know the private node IPs hosting ingress for your cluster and will direct traffic accordingly.

0
votes

Kubernetes services have few types, each building up on previous one : ClusterIP, NodePort and LoadBalancer. Only the last one will provision LoadBalancer in a cloud environment, so you can avoid it on GKE without fuzz. The question is, what then? Because, in best case you end up with an Ingress (I assume we expose ingress as in your question), that is available on volatile IPs (nodes can be rolled at any time and new ones will get new IPs) and high ports given by NodePort service. Meaning that not only you have no fixed IP to use, but also you would need to open something like http://:31978, which obviously is crap. Hence, in cloud, you have a simple solution of putting a cloud load balancer in front of it with LoadBalancer service type. This LB will ingest the traffic on port 80/443 and forward it to correct backing service/pods.