Use it to expose web applications, or when routes return 404/502 or wrong certificates.
Ingress and Gateway API
Ingress and the Gateway API route external HTTP(S) to Services by host and path through a controller (NGINX, Traefik, cloud LBs, Envoy-based gateways), terminating TLS.
1. kubectl get ingress,gateway,httproute -A.
2. Class/controller matches?
3. Backend Service and endpoints exist?
4. TLS secret valid for the host.
5. Controller logs and test curl -v https://<host>.
client → LB → controller → route by host/path → Service → pod
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
Confirm the Ingress has an ADDRESS. Test with curl and an explicit Host header. Read the controller logs for the request and its upstream status.
Step 2 Common failures Narrow the fault
A missing or wrong ingressClassName leaves the Ingress unhandled. Path type Prefix versus Exact changes matching. A TLS Secret in another namespace cannot be used.
An Ingress does nothing without a controller and matching ingressClassName. Gateway API separates infrastructure (Gateway) from routes (HTTPRoute). Check controller logs for config errors.
kubectl get ingress,gateway,httproute -A— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
ReferenceWhat it is1 section · depth on demand
How it works
The controller watches Ingress (or HTTPRoute) objects and configures its proxy (for example NGINX, Envoy, Traefik). Requests are matched by Host header and path, then forwarded to the endpoints of the backend Service.
ReferenceImportant terms & boundaries3 sections · depth on demand
Ingress vs Gateway API
| Ingress | Gateway API | |
|---|---|---|
| Resources | Ingress + controller annotations | GatewayClass, Gateway, HTTPRoute, … |
| Features | Host/path routing, TLS | + header matching, traffic splitting, cross-namespace delegation |
| Status | Stable, frozen | Successor, GA since 1.0 |
ingress-nginx is being retired (2026); plan migration to Gateway API implementations (Envoy Gateway, Cilium, NGINX Gateway Fabric, Istio). Check kubectl describe ingress for backend and TLS errors.
In depth
Ingress and Gateway API both describe HTTP routing into the cluster; a controller (NGINX, Envoy Gateway, Traefik, cloud load balancers …) does the actual work. Without a matching controller the objects do nothing.
Gateway API splits responsibility
| Resource | Owned by | Defines |
|---|---|---|
GatewayClass | Platform / vendor | Which controller implements it |
Gateway | Cluster operator | Listeners: hostname, port, protocol, TLS certificate |
HTTPRoute (also GRPCRoute, TLSRoute …) | Application team | Host/path/header matches → backend Services, weights |
A route attaches to a Gateway through parentRefs; the Gateway's allowedRoutes controls which namespaces may attach.
Worked HTTPRoute with a canary split
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata: { name: shop, namespace: shop }
spec:
parentRefs: [{ name: public, namespace: infra }]
hostnames: ["shop.example.com"]
rules:
- matches: [{ path: { type: PathPrefix, value: / } }]
backendRefs:
- { name: shop-v1, port: 80, weight: 90 }
- { name: shop-v2, port: 80, weight: 10 }
Reading status
kubectl -n shop get httproute shop -o jsonpath='{.status.parents[0].conditions}'
# Accepted=True, ResolvedRefs=True → attached and backends found
Accepted=False with reason NotAllowedByListeners means the Gateway does not allow routes from that namespace or hostname. A backend in another namespace needs a ReferenceGrant in the backend's namespace.
Common mistakes
- Ingress annotations specific to one controller used on another.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.