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

With `externalTrafficPolicy: Local`, a LoadBalancer Service drops some requests and the cloud LB marks half the nodes unhealthy.

IntermediateTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer

Likely causes → With Local, only nodes that run a ready Pod of the Service answer the healthCheckNodePort. Nodes without a Pod fail health checks by design. Drops happen when a node's last Pod is terminating while the LB still sends traffic.

Diagnose →

kubectl get svc web -o jsonpath='{.spec.externalTrafficPolicy} {.spec.healthCheckNodePort}{"\n"}'
kubectl get pods -l app=web -o wide
curl http://<node-ip>:<healthCheckNodePort>/healthz

Fix → That unhealthy status is expected. To avoid drops, spread Pods across nodes, add a preStop sleep longer than the LB health-check interval, or use IP targets (AWS LB Controller target-type: ip) so the LB sends traffic straight to Pods.

Prevent → Prefer IP-mode load balancing on EKS for client IP preservation without node-level health games.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, DNS, Ingress and NetworkPolicy