Skip to main content

Ingress

The difference between an ingress and a load balancer always confused me.

  • ingress - handles L7 routing within the cluster.
  • load balancer - handles L4 routing to the cluster.
ingress-loadbalancer

Different types of Kubernetes resources

Ingress is a separate kind whereas LoadBalancer is a type of Service.

A Kubernetes service is anything used to reach a set of pods. It can be a load balancer, a cluster IP, or a node port. This is always L4 routing. An ingress is a separate resource. It defines rules to route external HTTP/S traffic to services in the cluster. This is always L7 routing.

difference Kubernetes resource types

Ingress is a separate kind whereas LoadBalancer is a type of Service.

Overlap Implementations

What confuses more is that some Ingress controllers also create load balancers.

For example, create an ingress resource on a cloud provider like AWS or GCP. The ingress controller then also creates an external load balancer to route traffic to the cluster.

overlap and differences in implementations

In case of cloud providers,

  • The Ingress controller runs inside the cluster. But it creates a LoadBalancer resource outside the cluster.
  • You create only an Ingress resource. But the controller still makes an external LoadBalancer service to route traffic to the cluster.
Understand the controller implementation

To clear this up, see what the Ingress controller actually does. Check what it changes when an Ingress resource is created.