Interview Prep/Networking/Containers, Kubernetes, IPv6 and packet captures

`curl` to a pod IP works, but `curl` to the Service's ClusterIP times out.

IntermediateTroubleshootingContainers, Kubernetes, IPv6 and packet captures
Answer

Likely causes → The Service's targetPort doesn't match the container port, or kube-proxy (or its eBPF replacement) isn't programming rules on that node: crashed, wrong mode, or rules out of sync.

Diagnose →

kubectl get svc myapp -o jsonpath='{.spec.ports}'; echo
kubectl get endpointslices -l kubernetes.io/service-name=myapp -o yaml | grep -A3 ports
kubectl -n kube-system get pods -l k8s-app=kube-proxy -o wide
sudo iptables -t nat -S KUBE-SERVICES | grep <cluster-ip>      # iptables mode
sudo ipvsadm -Ln | grep -A3 <cluster-ip>                         # ipvs mode

Fix → Correct targetPort (name the container port and reference it by name), or restart/fix kube-proxy on the affected node.

Prevent → Use named ports and alert on kube-proxy sync_proxy_rules errors.

All Networking questions Roadmap: Networking for DevOps

More on Containers, Kubernetes, IPv6 and packet captures