Interview Prep/Kubernetes/Services, DNS, Ingress and NetworkPolicy

One replica receives almost all requests from an Ingress, while the other replicas sit idle.

AdvancedTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer

Likely causes → Session affinity is enabled (nginx.ingress.kubernetes.io/affinity: cookie or sessionAffinity: ClientIP on the Service), all clients come through one proxy IP, or long-lived HTTP/2/WebSocket connections stick to the first Pod they hit.

Diagnose →

kubectl get ingress web -o jsonpath='{.metadata.annotations}' | tr ',' '\n' | grep -i affin
kubectl get svc web -o jsonpath='{.spec.sessionAffinity}{"\n"}'
kubectl top pods -l app=web

Fix → Remove affinity unless the app really needs it; for long-lived connections set max connection age on the server so clients reconnect and rebalance.

Prevent → Stateless apps; load-distribution panels per Pod in dashboards.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, DNS, Ingress and NetworkPolicy