Appearance
Ingress, Gateway API and Traffic
368. What is Ingress, and what additional component is needed for Ingress rules to route traffic?
The short answer
An Ingress is a Kubernetes object that describes how outside HTTP and HTTPS traffic should reach Services inside the cluster: which host names and URL paths go to which Service, and which TLS certificate to use. On its own it does nothing. An Ingress controller must be running in the cluster: software, such as a proxy, that reads Ingress objects and configures itself to route traffic accordingly. Without a controller, Ingress objects are simply stored and ignored.
yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: shop
namespace: shop-prod
spec:
ingressClassName: public # (1)
tls:
- hosts: [shop.example.com]
secretName: shop-example-com-tls # (2)
rules:
- host: shop.example.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service: { name: checkout-api, port: { number: 80 } } # (3)
- path: /
pathType: Prefix
backend:
service: { name: web, port: { number: 80 } }- Which controller should handle this Ingress. Each installed controller registers an IngressClass.
- The TLS certificate and key, stored as a Secret (question 372).
- Requests to
shop.example.com/api...go to thecheckout-apiService. Everything else goes toweb. The longest matching path wins.
What the controller does:
- Runs as pods in the cluster, usually exposed through one
LoadBalancerService with a public address. - Watches Ingress objects of its class, and the Services and endpoints they point to.
- Turns them into its own proxy configuration, and reloads it when anything changes.
- Receives the outside traffic, ends TLS, matches host and path, and forwards each request to a ready pod.
Ingress has limits. Its standard fields cover only host and path routing and TLS. Anything else, such as rewrites, timeouts, header-based routing or traffic splits, is done with controller-specific annotations, which differ between controllers and are not checked. That is the gap Gateway API fills (question 370). The Ingress API itself is now considered complete: it is supported, but it will not gain new features.
369. What is an Ingress controller, and how does it differ from an Ingress resource?
The short answer
The Ingress resource is configuration: a declaration of routing rules, stored in the API like any other object. The Ingress controller is running software, a set of pods with a proxy inside, plus usually a cloud load balancer in front, that reads those declarations and actually handles the traffic. One controller serves many Ingress resources, and several different controllers can run in one cluster, each handling the Ingresses of its own class.
| Ingress resource | Ingress controller | |
|---|---|---|
| What it is | A YAML object | Pods running a proxy |
| Written by | App teams | Installed by the platform team |
| Does the routing | No | Yes |
| Examples | The shop Ingress above | Traefik, HAProxy, F5 NGINX, cloud controllers |
| Configured by | Its spec, plus annotations | Its own settings, plus the Ingresses it reads |
Several controllers in one cluster. A cluster might run a public controller for internet traffic and an internal one for company-only traffic. Each registers its own IngressClass:
yaml
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: internal
spec:
controller: example.com/internal-ingress-controllerAn Ingress with ingressClassName: internal is handled only by that controller.
Cloud controllers work differently. Some, such as the AWS Load Balancer Controller, do not run a proxy in the cluster at all. They configure a cloud load balancer, such as an AWS Application Load Balancer, directly from each Ingress, and the cloud does the routing.
A common interview point: "I created an Ingress and nothing happened" almost always means no controller is installed, or the Ingress names a class no controller handles.
370. What is Gateway API, and how does its resource model compare with the Ingress model?
The short answer
Gateway API is the newer, standard Kubernetes API for routing outside and internal traffic, stable since late 2023. It splits the work into separate objects for separate people. A GatewayClass names the type of gateway. A Gateway is the actual entry point, with its ports, host names and certificates, and is usually owned by the platform team. Route objects, such as HTTPRoute, are owned by each app team and attached to a Gateway. Features that Ingress needed annotations for, such as header matching, traffic splitting, redirects and rewrites, are proper, checked fields.
The objects:
| Object | Owned by | Describes |
|---|---|---|
GatewayClass | The infrastructure provider | Which implementation, such as Envoy Gateway or a cloud gateway |
Gateway | The platform team | Listeners: ports, protocols, host names, certificates, who may attach |
HTTPRoute, GRPCRoute, TLSRoute, TCPRoute | App teams | How their traffic is matched and where it goes |
ReferenceGrant | The target namespace's owners | Permission for a route in one namespace to point at a Service in another |
An HTTPRoute that splits traffic for a canary, with no annotations at all:
yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: shop
namespace: shop-prod
spec:
parentRefs:
- name: shop-gateway
namespace: gateway-system # (1)
hostnames: [shop.example.com]
rules:
- matches:
- path: { type: PathPrefix, value: /api }
backendRefs:
- { name: checkout-api-stable, port: 80, weight: 90 } # (2)
- { name: checkout-api-canary, port: 80, weight: 10 }
- backendRefs:
- { name: web, port: 80 }- Attaches this route to the shared gateway, which lives in another namespace and is owned by another team.
- 90% of
/apitraffic to the stable version, 10% to the canary (question 481).
Compared with Ingress:
| Ingress | Gateway API | |
|---|---|---|
| Objects | One | Several, by role |
| Advanced routing | Controller-specific annotations | Standard, checked fields |
| Traffic splitting by weight | Not standard | Built in |
| Protocols | HTTP and HTTPS | HTTP, gRPC, TLS, TCP, UDP |
| Sharing one entry point across teams | Awkward | Designed for it |
| Status feedback | Little | Conditions on each Gateway and route |
Status helps debugging. Each route reports whether it was accepted by its gateway and whether its backends were resolved, which answers "why is my route not working?" directly (question 373).
371. How would you choose between a cloud load balancer, Ingress, and Gateway API for external traffic?
The short answer
Use a plain cloud load balancer, a LoadBalancer Service, for non-HTTP traffic, such as raw TCP or UDP, or for one single service. Use Gateway API for HTTP and HTTPS in new set-ups, because it is the actively developed standard, supports sharing one entry point between teams, and has advanced routing built in. Keep Ingress only where an existing, supported controller already works well, since the Ingress API no longer gains features and the most popular community controller, ingress-nginx, was retired in March 2026.
| Need | Choose |
|---|---|
| TCP or UDP service, such as a game server or MQTT broker | LoadBalancer Service |
| One simple HTTP service, no shared entry point | LoadBalancer Service, or a gateway |
| Many HTTP services behind one address | Gateway API |
| Several teams sharing one entry point | Gateway API |
| Canary splits, header routing, mirroring | Gateway API |
| An existing, healthy Ingress set-up | Keep it, plan a move to Gateway API |
| A cloud-managed layer 7 load balancer | The cloud's Gateway API controller |
Managed options on each cloud. Clouds now offer gateways that implement Gateway API with a managed load balancer underneath: Azure's Application Gateway for Containers, the AWS Load Balancer Controller's Gateway support, and GKE's built-in Gateway controller. They move the proxy out of your cluster, which means less to run, at the cost of cloud-specific behaviour.
Self-run options. Envoy Gateway, Istio, Cilium, Traefik, Kong and NGINX Gateway Fabric all implement Gateway API inside the cluster.
Costs to remember:
- Each
LoadBalancerService usually means a separate cloud load balancer, billed separately, with its own public address. - A shared gateway is one load balancer for many services, but it is a shared component, so its capacity and availability matter to everyone behind it.
372. How do TLS termination and certificate management work for inbound traffic to a Kubernetes application?
The short answer
TLS is usually ended, or terminated, at the cluster's entry point, the gateway or ingress controller, which holds the certificate and decrypts the traffic before sending it on. It can also end earlier, at a cloud load balancer or CDN, or later, at the pod itself, for end-to-end encryption. Certificates are stored as Kubernetes Secrets and referenced by the Gateway or Ingress. cert-manager is the usual tool to request them automatically, from Let's Encrypt or an internal authority, and renew them before they expire.
The three places TLS can end:
- At the edge, a CDN or cloud load balancer. It decrypts, inspects, and sends traffic on, ideally encrypted again, to the cluster.
- At the gateway or ingress controller. The usual choice: one place holds certificates for many services, and traffic inside the cluster may be plain HTTP or encrypted again.
- At the pod, with the gateway passing encrypted traffic straight through. Used when the pod itself must prove its identity, or when rules require encryption all the way.
Inside the cluster, traffic between the gateway and pods can be plain, re-encrypted with TLS, or protected automatically by a service mesh's mutual TLS (question 514).
Certificates as Secrets. A Gateway or Ingress refers to a Secret of type kubernetes.io/tls, holding tls.crt and tls.key.
cert-manager automates them:
yaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: shop-example-com
namespace: gateway-system
spec:
secretName: shop-example-com-tls # (1)
dnsNames: [shop.example.com]
issuerRef:
kind: ClusterIssuer
name: letsencrypt-prod # (2)- The Secret it creates and keeps up to date.
- Which issuer to ask. Let's Encrypt is a free, automated certificate authority. To prove you control
shop.example.com, cert-manager answers a challenge: either by serving a token over HTTP, or by creating a DNS record. cert-manager renews well before expiry, and Let's Encrypt certificates are short-lived, about 90 days, so automation is essential.
Cloud alternatives keep certificates in the cloud's own store, such as Azure Key Vault used by Application Gateway for Containers, or AWS Certificate Manager used by AWS load balancers, so the private key never enters the cluster.
And always: monitor certificate expiry. An expired certificate takes a service down as completely as a crash does.
373. How would you troubleshoot a Service that works from inside the cluster but is unreachable externally?
The short answer
Then the pods and the internal Service are fine, and the problem is somewhere on the outside path. Check these in order. Does the DNS name point at the right public address? Does the load balancer exist and have an address, rather than pending? Do its health checks pass? Do cloud firewall rules allow the port? Did the gateway or ingress accept the route, and does it match the host name and path? Is the certificate valid? Do network policies allow traffic from the gateway's namespace to the app?
Work from the outside in:
bash
dig +short shop.example.com # (1)
kubectl get svc -n gateway-system # (2)
kubectl describe svc shop-gateway -n gateway-system | tail -20 # (3)
kubectl get gateway,httproute -A # (4)
kubectl describe httproute shop -n shop-prod # (5)
curl -v --resolve shop.example.com:443:20.61.8.4 https://shop.example.com/api/healthz # (6)- Does the name resolve to the load balancer's address?
- Does the gateway's
LoadBalancerService have anEXTERNAL-IP?<pending>means the cloud never created one: look at the Service's events for quota, permission or subnet errors from the cloud controller (question 318). - Events for the Service, including cloud errors.
- Are the Gateway and the routes there?
- The route's status conditions:
Accepted: Falsemeans the gateway refused it, often because the namespace is not allowed to attach, andResolvedRefs: Falsemeans a backend Service name or port is wrong. - Sends a request to the load balancer's address directly, with the right host name, which separates DNS problems from everything else.
The usual causes:
| Symptom | Likely cause |
|---|---|
| Name resolves to an old or wrong address | DNS record not updated |
EXTERNAL-IP pending | Cloud quota, permissions or subnet problem |
| Connection times out | Cloud firewall or network security group blocks the port |
| Load balancer up, all backends unhealthy | Health check path or port wrong; with externalTrafficPolicy: Local, no gateway pods on those nodes |
| 404 from the gateway | Host name or path does not match any route |
| Route not accepted | The gateway does not allow routes from that namespace |
| Certificate error | Wrong or expired certificate, or the name does not match |
| 502 or 503 from the gateway | Gateway reaches no ready pods, or a network policy blocks it |
The network policy trap. If the app's namespace has a default-deny policy, traffic from the gateway's namespace must be explicitly allowed. Inside-the-cluster checks from the same namespace pass, while everything through the gateway fails (question 367).
374. How would you troubleshoot a Pod that can reach another Pod by IP address but not by Service name?
The short answer
Pod-to-pod networking works, so split the remaining problem into its two parts: name resolution, and the Service itself. First test whether the name resolves. If it does not, look at DNS: CoreDNS health, the exact name and namespace, and network policies that block DNS traffic. If it resolves but connections fail, look at the Service: its endpoints, its ports, and the Service rules on the node.
Step 1: does the name resolve?
bash
kubectl exec -n shop-prod web-6f5c-abcde -- nslookup checkout-api
kubectl exec -n shop-prod web-6f5c-abcde -- nslookup checkout-api.shop-prod.svc.cluster.localIf it does not resolve:
- Wrong name or namespace. From another namespace, the short name does not work (question 364).
- CoreDNS problems.
kubectl get pods -n kube-system -l k8s-app=kube-dns, then their logs. Are they running, and not crash-looping or out of memory? - DNS blocked by a network policy. With egress denied by default, the pod cannot reach CoreDNS on port 53 (question 367).
- The pod's DNS settings.
cat /etc/resolv.confinside the pod. A customdnsPolicyordnsConfigmay have replaced the cluster DNS.
If it resolves but connections fail:
- No endpoints.
kubectl get endpointslices -l kubernetes.io/service-name=checkout-api(question 362). - Wrong port. The caller uses the Service's
port, which must map to the righttargetPort. - Service rules broken on that node. Is kube-proxy, or the network plugin that replaces it, healthy on the caller's node? A broken agent on one node breaks Services only for pods on that node.
- A network policy. Policies apply to the real pod addresses, after the Service address is translated. So a policy that lets the caller reach the pods' labels works. A policy that tries to allow "the Service" cannot be written, because policies have no such concept.
375. How would you troubleshoot intermittent DNS lookup failures inside a cluster?
The short answer
Check whether CoreDNS has enough capacity, since it is often overloaded or restarting. Check the ndots:5 setting, which turns one lookup for an outside name into several. Look for the known Linux connection-tracking race that drops some DNS packets and causes five-second delays, which NodeLocal DNSCache fixes. Check for limits on the cloud's own DNS servers, and differences in how some images, such as Alpine, resolve names. Use CoreDNS's own metrics and logs to see the pattern.
1. Is CoreDNS overloaded?
bash
kubectl get pods -n kube-system -l k8s-app=kube-dns -o wide
kubectl top pods -n kube-system -l k8s-app=kube-dns
kubectl logs -n kube-system -l k8s-app=kube-dns --tail=50Look for restarts, high CPU, and errors such as i/o timeout towards the upstream servers. CoreDNS exposes metrics such as request counts, errors and response times, which show whether failures follow traffic peaks. The fix is more replicas, often scaled with the number of nodes by an autoscaler.
2. The ndots:5 effect. Pods have options ndots:5 (question 363). A lookup for api.stripe.com, which has two dots, is first tried with every search suffix:
text
api.stripe.com.shop-prod.svc.cluster.local → not found
api.stripe.com.svc.cluster.local → not found
api.stripe.com.cluster.local → not found
api.stripe.com → foundEvery outside lookup costs several extra queries, often for both IPv4 and IPv6, multiplying DNS traffic. Fixes: write outside names with a trailing dot, api.stripe.com., which marks them as complete, or lower ndots for that pod:
yaml
spec:
dnsConfig:
options:
- name: ndots
value: "2"3. The connection-tracking race. On Linux, a program may send its IPv4 and IPv6 queries at the same moment, over the same connection. A known race in the kernel's conntrack, the table that tracks connections for address translation, can then drop one of the packets. The program waits for its timeout, often five seconds, then retries. Symptom: occasional lookups that take exactly about five seconds. Fixes:
- NodeLocal DNSCache: a small DNS cache running on every node as a DaemonSet. Pods ask it locally, avoiding the address translation where the race happens, and it talks to CoreDNS over TCP.
- For images using glibc, the resolver option
single-request-reopen.
4. Cloud limits. Cloud DNS servers can limit queries per network interface. AWS, for example, limits each network interface to 1,024 DNS packets per second. A busy node can hit it, causing drops that look random. Node-local caching helps here too.
5. The image's resolver. Alpine's musl resolver behaves differently from glibc's in some situations, such as search domains (question 71).
376. How would you trace a request from an external client through DNS, a load balancer, an ingress or gateway, a Service, and a Pod?
The short answer
Follow the request hop by hop, and at each hop check one thing. DNS answers with the right address. The TLS handshake succeeds with the right certificate. The load balancer has healthy backends and forwards the request. The gateway matches a route, and logs which backend it used. The Service has ready endpoints. The pod logs the request and its result. A request ID passed through every hop, and distributed tracing, let you find the same request in every component's logs.
Hop by hop:
- DNS.
dig shop.example.comreturns the expected address? A short time-to-live helps when records change. - TLS and the load balancer.
openssl s_client -connect shop.example.com:443 -servername shop.example.comshows the certificate presented and whether the handshake works. The cloud load balancer's metrics show healthy backends and request counts. - The gateway. Its access log records each request: the host, path, status, time taken, and which backend address it chose. A
404means no route matched. A503means no healthy backend. - The Service. Its EndpointSlices list ready pods (question 361). If the gateway chose an address that is not in the list, routing state is stale.
- The pod. The app's own log for that request: did it arrive, what did the app do, what did it return?
- Dependencies. If the app was slow, which call made it slow?
Making it one story. The gateway adds, or passes on, a request ID header, such as X-Request-ID. Every component logs it. Searching your log store for that one ID shows the request's whole journey. Distributed tracing, for example with OpenTelemetry, goes further: each hop records timed spans, and a trace view shows exactly where the time went (question 634).
491. What happened to ingress-nginx, and what should teams move to?
The short answer
The Kubernetes community's ingress-nginx controller, for years the most widely used Ingress controller, was retired in March 2026. Its maintainers announced in November 2025 that maintenance would stop then: no more releases, bug fixes or security patches. Existing installations keep running, but every new vulnerability stays unpatched. The recommended path is Gateway API, with one of its implementations, or another actively maintained Ingress controller.
What exactly was retired. The project kubernetes/ingress-nginx, maintained by the Kubernetes community. It is different from the F5 NGINX Ingress Controller, sold and maintained by the company behind NGINX, which continues. People confuse the two because of the similar names.
Why it was retired. It was maintained by a very small group of volunteers. Its huge set of annotations, including ones that allowed raw configuration snippets, was hard to keep secure. In March 2025 a group of critical flaws, nicknamed IngressNightmare, showed how a request reaching the controller's admission webhook could lead to a cluster takeover. The maintainers judged they could not keep it safe, and the Kubernetes steering and security committees backed the decision. Some vendors announced their own extended support for paying customers.
What to do:
- Inventory. List every Ingress using the
nginxclass, and every annotation they rely on, such as rewrites, timeouts, body size limits and authentication. - Choose a target.
- Gateway API, the long-term direction, with implementations such as Envoy Gateway, Istio, Cilium, NGINX Gateway Fabric, Traefik, Kong, or a cloud gateway (question 371).
- Another maintained Ingress controller, if a faster, smaller move is needed first.
- Translate. A tool called
ingress2gatewayconverts Ingress objects into Gateway API objects. Annotations need care: there is no automatic one-to-one mapping, and some behaviour must be rebuilt with route filters or policies. - Run both side by side. Install the new gateway with its own address, check every route against it, then move DNS, service by service.
- Remove the old controller once nothing uses it.
Why interviewers ask in 2026: it tests whether you follow your ecosystem, and whether you can plan a migration of something central without downtime.