- The Kubernetes LoadBalancer Service is used for L4 load balancing, which means it is done at OSI layer 4 (transport). The load balancer can make the decisions based on the TCP/UDP protocol.
Applications that use HTTP or HTTPS protocols often require L7 load balancing, which is done at OSI layer 7 (application). Thus, the L4 load balancer cannot do HTTPS traffic termination and offloading.
- L4 LoadBalancer cannot implement name-based virtual hosting using the same L4 load balancer for multiple domain names.
You need an L7 load balancer to implement path-based routing.
- In Kubernetes, you can resolve these problems using an Ingress object, which can be used for implementing and modeling L7 load balancing. The Ingress object is used for defining the routing and balancing rules only, for example, which path should be routed to which Kubernetes Service.
![](https://devops-wala.com/wp-content/uploads/2024/05/2024-05-01_14h03_25-1024x571.png)
First, we will deploy the Ingress Controller. It can be any of them, its totally up to us. which one is suitable as per our requirement. I will talk about this in details. No worries. Just start with very basic. In addition to this, we need to configure the rules. This is what we called Ingress resources. It is a simple YAML file.
Now, you understand the difference between Ingress controller and Ingress resources.
Point to be noted here, that Ingress controller is not come by default. We must create it manually. Ingress resources can’t work without the Ingress Controller and vise-versa. In simple words, the Ingress resource defines the routing rules, and the controller implements them.
Nginx controller is supported by Kubernetes. Thus, I will explain NGINX controller in this post.
There are different type of Ingress Controller in the market. Same can be observed on Kubernetes.io web portal. Portal
![](https://devops-wala.com/wp-content/uploads/2024/05/Picture1.png)