categories.containers-platform Intermediate
What is Kubernetes Ingress? How does it differ from a LoadBalancer Service?
What Ingress Does
Ingress is an API object that manages external HTTP/HTTPS traffic entering the cluster, providing:
- URL path-based routing (/api → backend service, / → frontend service)
- Host-based routing (api.example.com vs app.example.com)
- TLS termination (SSL offloading)
- A unified external entry point (single LoadBalancer serving multiple apps)
Ingress vs LoadBalancer Service
| Approach | Best For | Cost |
|---|---|---|
| LoadBalancer Service | Non-HTTP services, single app | One cloud LB per Service (expensive) |
| Ingress | Multiple HTTP/HTTPS services | One LB for multiple backends (cost-effective) |
Configuration Example
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-ingress spec: rules:
- host: api.example.com
http:
paths:
- path: /users pathType: Prefix backend: service: name: user-service port: number: 80
Ingress Controller
Ingress is just a rule definition — you need an Ingress Controller to actually process traffic. Common options:
- nginx-ingress: Most widely used
- Traefik: Native support for dynamic configuration
- AWS ALB Ingress: Native integration for AWS environments
✦ AI Mock Interview
Type your answer and get instant AI feedback
Sign in to use AI scoring
