Introducing the Ingress object
In the previous section, we did a short recap of Service objects in Kubernetes and their role in routing traffic. From the perspective of external traffic, the most important are the NodePort
Service and the LoadBalancer
Service. In general, the NodePort
Service can only be used in conjunction with a different routing and load balancing component, as exposing multiple external endpoints on all Kubernetes Nodes is not secure. This leaves us with the LoadBalancer
Service, which, under the hood, relies on NodePort
. There are a few problems with this type of Service in some use cases:
- The
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). - The L4 load balancer cannot do HTTPS traffic termination and offloading...