Kubernetes Ingress Explained
On this page
Why one load balancer per service doesn't scale
You expose the storefront, the API and the admin site with three LoadBalancer Services (Day 19). That's three public IPs, three cloud load balancers to pay for, three TLS certificates to manage, and no way to route /api and / on the same domain. Ingress puts one HTTP entry point in front of many Services.
Ingress resources and ingress controllers
- An Ingress object declares routing rules: hosts, paths, which Service gets which traffic, and TLS.
- An Ingress controller is a proxy running in the cluster that watches Ingress objects and configures itself to implement them. Examples: ingress-nginx, Traefik, HAProxy, cloud-native controllers for AWS ALB or Azure Application Gateway.
An Ingress with no controller installed does nothing; that's the most common first surprise. The controller itself is usually exposed through one LoadBalancer Service.
Ingress example: host and path routing with TLS
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: shop
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: nginx
tls:
- hosts: ["shop.example.com", "admin.example.com"]
secretName: shop-tls
rules:
- host: shop.example.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service: { name: orders-api, port: { number: 80 } }
- path: /
pathType: Prefix
backend:
service: { name: storefront, port: { number: 80 } }
- host: admin.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service: { name: admin, port: { number: 80 } }shop.example.com/api/... goes to the API, everything else on that host to the storefront, and the admin host to the admin site. The longest matching path wins.
TLS is terminated at the controller using the certificate in the shop-tls Secret. cert-manager, triggered by the annotation, obtains and renews that certificate from Let's Encrypt automatically, which removes the classic "certificate expired" outage.
The Gateway API: the successor to Ingress
Ingress covers only basic HTTP routing; anything more (header matching, traffic splitting, timeouts) ends up in controller-specific annotations that don't carry between controllers. The Gateway API is the newer, standard successor:
- GatewayClass and Gateway describe the entry point, owned by the platform team.
- HTTPRoute (and GRPCRoute, TCPRoute) describe routing, owned by application teams in their namespaces.
- Weighted backends, header matches and redirects are part of the standard.
The platform team defines the entry point once, with its listener, TLS certificate and the namespaces allowed to attach routes:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: public-gateway
namespace: infra
spec:
gatewayClassName: eg # Envoy Gateway's class; other implementations use their own
listeners:
- name: https
protocol: HTTPS
port: 443
hostname: "*.example.com"
tls:
certificateRefs: [{ name: wildcard-example-com }]
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels: { gateway-access: "true" }Application teams then attach routes to it from their own namespaces, if those carry the gateway-access: "true" label. The route below splits traffic for a canary:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: orders-api
spec:
parentRefs: [{ name: public-gateway, namespace: infra }]
hostnames: ["shop.example.com"]
rules:
- matches: [{ path: { type: PathPrefix, value: /api } }]
backendRefs:
- { name: orders-api, port: 80, weight: 90 }
- { name: orders-api-canary, port: 80, weight: 10 } # canary, Day 27Most controllers support both today. For new setups, the Gateway API is the direction Kubernetes is going. The ingress-nginx controller, the most common one, was retired: maintenance ended in March 2026, and there are no further releases or security fixes. Existing installations keep working, but plan a move to a Gateway API implementation or another maintained Ingress controller (Kubernetes blog, 2025).
Debugging Ingress 404 and 503 errors
kubectl get ingress shop # is an ADDRESS assigned?
kubectl describe ingress shop # rules, backends, events
kubectl get svc,endpointslices -l app=orders-api # do the backends have endpoints?
kubectl logs -n ingress-nginx deploy/ingress-nginx-controller # controller errorsA 404 from the controller usually means no rule matched the host or path; a 503 usually means the backend Service has no ready endpoints.
Check yourself
Check that an ingress controller, such as ingress-nginx, Traefik or a cloud controller, is installed and that the Ingress's ingressClassName matches it. An Ingress is just a set of rules; without a controller watching for it, nothing configures a proxy, and requests go nowhere.
It automates TLS certificates: it requests certificates from an issuer such as Let's Encrypt, completes the validation challenge, stores the certificate in the Secret the Ingress references, and renews it before it expires. Without it, someone has to remember to replace certificates by hand.
Ingress covers only basic host and path routing, so features like traffic splitting, header matching and timeouts ended up in controller-specific annotations that don't carry over between controllers. The Gateway API standardizes them and separates roles: platform teams manage Gateways, app teams manage Routes.
Whether the backend Service exists in the same namespace with the right name and port, and whether it has ready endpoints. A 503 from the controller usually means it found the rule but had no healthy Pods to send traffic to.