Hey Cloudees โ๏ธ!
Managing application traffic in Kubernetes can be challenging, especially when have multiple services running. That's where ๐ฒ๐๐๐๐๐๐๐๐๐ ๐ฐ๐๐๐๐๐๐ comes into play!
Before getting into K8S Ingress first let's understand What is Layer 4 and Layer 7 Load Balancing.
๐๐๐ฒ๐๐ซ๐:
๐ Operates at Transport layer of Operating System(TCP/UDP). It make decisions based on the available information in this transport layer.
๐ It Doesn't have intelligence to transport based on the request.
๐ Requires separate SSL Termination.
Ex: K8S Load Balancer
๐๐๐ฒ๐๐ซ๐:
๐ It Operates at Application level, it makes decisions based on application requests like http/https.
๐ It has the intelligence to distribute the load based on the application requests ( ex: /login, /admin .. etc)
๐ It can terminate SSL connections
Ex: K8S Ingress, AWS LoadBalancer, Azure Application Gateway..
๐พ๐๐๐๐๐๐ ๐ฐ๐๐๐๐๐๐:
๐ We cannot Expose our application externally by using clusterIP service.
๐ Exposing the app via NodePort can be a security Concern.
๐ Exposing app via LoadBalancer is much expensive and it will point only app/one service at a time.
To checkmate all these there is a concept called " Ingress "
๐พ๐๐๐ ๐๐ ๐ฐ๐๐๐๐๐๐? :
Ingress is an API object in K8S that manages external HTTP/HTTPS access to services running in the K8S cluster.
๐ It is a Layer7 load balancer.
๐ It acts as an entry point to the K8S cluster.
๐ It allows to define rules for routing incoming requests to the appropriate Services based on the URL path's / Host names.
It has 2 components:
โจ Ingress Controller
โจ Ingress Resources
๐ ๐ฐ๐๐๐๐๐๐ ๐ช๐๐๐๐๐๐๐๐๐:
It is a K8S object, While Ingress defines the routing rules, Ingress Controller watches for these rules and performs the routing.
๐ ๐ฐ๐๐๐๐๐๐ ๐น๐๐๐๐๐๐๐๐:
It is a K8S object where we define the routing rules like how the load balancing should be done.
๐ฐ๐๐๐๐๐๐ ๐จ๐๐๐๐๐๐๐๐๐๐๐:
After we create an Ingress resource in K8S. A Cloud provider LoadBalancing URL/IP will be assigned to access.
๐ When users trying to access the application using LoadBalancing URL/IP address the traffic will first hit the Ingress controller
๐ The Ingress Controller always watches the Ingress Resource rules/ for any modifications.
๐ Based on the rules it will pass the request to the specific pod/Deployment service(ClusterIP).
๐ Through internal communication the ClusterIP service will pass the request to the respective pod and the pod will carry forward the request.
Workflow:
User -> Cloud provider LoadBalancer -> Ingress Controller -> Service( ClusterIP) -> Pod.
Note:
๐ Here we need Service for each Deployment or Pod
Do comment down your thoughts ๐ญ
Top comments (0)