Ingress
Ingress is a Kubernetes API object that routes external HTTP and HTTPS traffic to Services inside a cluster based on hostnames and paths. It lets many services share one load balancer instead of each needing its own, but it only works when an Ingress controller is installed.
The problem it solves
Giving every Service its own LoadBalancer means one cloud load balancer, one IP, and one bill per service. Ingress puts a single entry point in front of many services and routes by rules.
Resource vs controller
- The Ingress resource is the YAML that defines routing rules.
- The Ingress controller is the software that reads those rules and serves traffic, for example NGINX, Traefik, HAProxy, or a cloud-native controller such as the AWS Load Balancer Controller.
Kubernetes does not ship a controller. An Ingress object without one does nothing.
RememberCheck the project status of your controller before adopting it. The community ingress-nginx project was announced for retirement in 2026, so for new clusters evaluate alternatives and the Gateway API, which is the more expressive successor to Ingress.
Example
apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: payments-routing namespace: productionspec: ingressClassName: nginx tls: - hosts: - api.example.com secretName: api-example-tls rules: - host: api.example.com http: paths: - path: /payments pathType: Prefix backend: service: name: payment-service port: number: 80 - path: /accounts pathType: Prefix backend: service: name: account-service port: number: 80Path types
| Type | Behaviour |
|---|---|
| Prefix | Matches the path and everything beneath it |
| Exact | Matches only that exact path |
| ImplementationSpecific | Controller-defined, avoid unless needed |
Troubleshooting
kubectl get ingress -Akubectl describe ingress payments-routing -n productionkubectl get secret api-example-tls -n productionSecurityNever expose admin UIs such as Grafana, Argo CD, or the Kubernetes dashboard through Ingress without authentication. Terminate TLS and force HTTPS redirects.
Common MistakeUsing
Exactwhen you meantPrefix. Sub-paths such as/payments/upithen return 404.
Frequently Asked Questions
What does Ingress do that a LoadBalancer Service does not?
It shares one external load balancer across many services and routes by hostname and path. A LoadBalancer Service exposes a single service and provisions its own load balancer.
Why did my Ingress change nothing?
No Ingress controller is running, or ingressClassName does not match the installed controller. The resource is only configuration until a controller acts on it.
Ingress or Gateway API?
Ingress is simple and widely supported. Gateway API offers richer, role-oriented routing such as header matching and traffic weighting and is the direction of the ecosystem for new designs.