Medium java docker

What is an Ingress controller?

The 30 second answer

Ingress is a Kubernetes API that describes HTTP (and HTTPS) routing from outside the cluster to Services: host, path, and TLS. An Ingress controller is the software that reads those objects and actually programmes a load balancer or reverse proxy (NGINX, Envoy, a cloud LB). The Ingress object does nothing on its own if no controller is running. Gateway API is the newer, more expressive successor, but Ingress is still what many interviews and clusters use.

Could you say this in an interview?

A Service of type LoadBalancer or NodePort exposes a Service as a whole. Ingress sits one layer up for L7 HTTP: one entry point, many routes, TLS termination.

Two pieces have to exist:

  1. An Ingress resource: rules such as checkout.example.com/api → Service checkout:80.
  2. An Ingress controller: a Deployment in the cluster (or a managed controller) that watches Ingress objects and configures the actual proxy. Installing only the resource, with no controller, has no effect. The Kubernetes Ingress docs emphasise this.

TLS is usually a Secret referenced by the Ingress, often minted by cert-manager. Path matching, prefix versus exact, and how trailing slashes work are controller-specific; I would check the controller's documentation rather than invent a universal rule.

Gateway API is the official next generation (Gateway, HTTPRoute, more role separation). I mention it, and I still know Ingress because it is what most existing clusters have.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop
spec:
  ingressClassName: nginx
  tls:
    - hosts: ["shop.example.com"]
      secretName: shop-tls
  rules:
    - host: shop.example.com
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: checkout
                port:
                  number: 80
Sources (3)
  1. Kubernetes: Ingresskubernetes.io
  2. Kubernetes: Ingress controllerskubernetes.io
  3. Kubernetes: Gateway APIkubernetes.io