Load balancer & ingress?

Why, while installing rancher with HA via RKE, you are requested to create a load balancer and also an ingress?
Which advantages you get from the LB that can’t be achieved by the nginx ingress?

Hello @bentzy ,

Here is an explanation from Google:

While ingresses and load balancers have a lot of overlap in functionality, they behave differently. The main difference is ingresses are native objects inside the cluster that can route to multiple services, while load balancers are external to the cluster and only route to a single service.

Here is how my setup is configured.

The LB sits in front of the K8s nodes and performs health checks against nodes to maintain pool of active /responsive servers dynamically. The LB can be external or internal (ie - MetalLB) . If using and external LB (in my case), you would point a wildcard DNS record to the Load Balancer IP address which in turn routes traffic to the K8s nodes.

DNS looks like this for the infra K8s cluster :

*.infra.company.net > 10.10.10.1 (external LB IP)

This wildcard DNS covers all apps in the cluster exposed via HTTPS

consul.infra.company.net
artifactory.infra.company.net
rspm.infra.company.net

The Ingress Controller forwards the request based on the domain (URL) to the appropriate service.

Here is a diagram
image

Now, imagine a scenario without a LB.
Technically you could get away with a wildcard (Round-Robin) DNS record pointing to each of the K8s nodes, but this isn’t optimal for obvious reasons.

There are various ways to configure it.
This fantastic video by Adrian Goins explains it pretty well.
https://youtu.be/Ytc24Y0YrXE

2 Likes