Stage 7, Part 3 of 9 · p. 58, Kubernetes Networking Deep Dive

PART 3: PRODUCTION FAILURE MODES

17. Top 10 Kubernetes Networking Failures

#FailureSymptomRoot CauseFix
1Service has no endpointsConnection refusedSelector mismatchFix labels
2DNS resolution fails"Name not resolved"CoreDNS down, ndotsCheck CoreDNS, NodeLocal
35-second DNS timeoutIntermittent 5s stallsconntrack raceNodeLocal DNSCache
4CNI pod not readyPods stuck PendingCNI daemonset downCheck CNI logs
5NetworkPolicy blocks trafficConnection timeoutOverly strict policyTest with allow-all
6IP exhaustionPods can't get IPsPod CIDR exhaustedExpand CIDR, prefix delegation
7Ingress 502 errorsBad GatewayBackend not readyCheck endpoints
8Cross-node traffic failsPods can't reach each otherRouting issueCheck CNI, node routes
9kube-proxy stale rulesService unreachableRule programming lagRestart kube-proxy
10Gateway API misconfiguration404 errorsWrong parentRefsCheck Gateway/Route

18. Networking Debugging Runbook

"Service is Unreachable" — Step-by-Step

text
STEP 1: Check the Service
  $ kubectl get svc <service> -o yaml
  # Verify selector, port, targetPort

STEP 2: Check endpoints
  $ kubectl get endpoints <service>
  $ kubectl get endpointslices -l kubernetes.io/service-name=<service>
  # Empty endpoints = selector mismatch

STEP 3: Check Pods match selector
  $ kubectl get pods -l <selector>
  # If no pods, fix labels

STEP 4: Check Pod readiness
  $ kubectl get pods -l <selector>
  # If not Ready, check readiness probes

STEP 5: Test from inside cluster
  $ kubectl run test --image=busybox --rm -it --restart=Never -- \
    wget -qO- <service>:<port>

STEP 6: Check DNS
  $ kubectl run test --image=busybox --rm -it --restart=Never -- \
    nslookup <service>

STEP 7: Check NetworkPolicy
  $ kubectl get networkpolicies -A
  # Look for default-deny or restricting policies

STEP 8: Check kube-proxy
  $ kubectl get pods -n kube-system -l k8s-app=kube-proxy
  $ kubectl logs -n kube-system -l k8s-app=kube-proxy --tail=50

STEP 9: Check CNI
  $ kubectl get pods -n kube-system -l k8s-app=cilium
  $ kubectl logs -n kube-system -l k8s-app=cilium --tail=50

STEP 10: Escalate

Quick Diagnostic Table

SymptomFirst CheckThen
No endpointskubectl get endpointsFix selector
DNS failsCoreDNS podsNodeLocal DNSCache
502/503Backend readinessIngress logs
TimeoutNetworkPolicyCNI logs
Cross-node failNode routesCNI routing

19. Blast Radius Analysis

What Happens When Networking Fails?

ComponentImpactSeverity
CNI downAll new Pods can't networkSEV-1
CoreDNS downService discovery failsSEV-1
kube-proxy downServices unreachableSEV-1
Ingress downExternal access failsSEV-1
NetworkPolicy misconfigTraffic blockedSEV-2
IP exhaustionPods stuck PendingSEV-1
5s DNS timeoutIntermittent latencySEV-2

Mitigation Strategies

StrategyImplementation
HA CoreDNS3+ replicas, PDB
NodeLocal DNSCacheEliminates conntrack race
HA Ingress3+ replicas, anti-affinity
CNI HADaemonSet on every node
IP capacity planningMonitor CIDR utilization
NetworkPolicy testingAudit before enforce

1:1 copy of the class Google Doc, code in code blocks.