Networking Deep Dive›Kubernetes Dataplane · Cheat sheet & self-check
Learning Hub / Kubernetes & Platform / Networking Deep Dive

Kubernetes Dataplane · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

05 · CNI plugins compared

Identify the CNI

ls /etc/cni/net.d/Which CNI config is active on a node
kubectl get pods -n kube-system -o wide | grep -E 'calico|cilium|flannel|kindnet|aws-node'CNI agent pods
kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'Per-node pod CIDRs (if the CNI uses them)

CNI-specific tools

cilium status / cilium connectivity testCilium health and an end-to-end test suite
hubble observe --namespace shopCilium: live flow logs
calicoctl node statusCalico: BGP peering status

06 · Services, kube-proxy & eBPF

Which mode am I in?

kubectl -n kube-system get cm kube-proxy -o yaml | grep modekube-proxy mode (empty = platform default)
curl -s localhost:10249/proxyModeAsk kube-proxy on a node
cilium status | grep KubeProxyReplacementCilium replacing kube-proxy?

Inspect the rules

sudo iptables -t nat -L KUBE-SERVICES -n | headiptables mode Service rules
sudo ipvsadm -LnIPVS mode virtual servers and backends
sudo nft list table ip kube-proxy | head -50nftables mode rules
cilium service listeBPF service table (Cilium)

07 · DNS end to end

Inspect

kubectl exec <pod> -- cat /etc/resolv.confThe pod's resolver config
kubectl -n kube-system get cm coredns -o yamlThe Corefile (CoreDNS configuration)
kubectl -n kube-system logs -l k8s-app=kube-dnsCoreDNS logs (enable the 'log' plugin to see queries)

Test

kubectl run dns --rm -it --image=busybox:1.36 --restart=Never -- nslookup web.shopResolve a Service
dig +search webResolve using search domains (where dig is available)
dig @10.96.0.10 web.shop.svc.cluster.localAsk CoreDNS directly by its Service IP

08 · Load balancing & proxies

MetalLB

kubectl get ipaddresspools,l2advertisements,bgpadvertisements -n metallb-systemMetalLB configuration
kubectl get svc -A --field-selector spec.type=LoadBalancerLoadBalancer Services and their external IPs
kubectl -n metallb-system logs -l component=speakerWhich node announces which IP

Client IP

externalTrafficPolicy: LocalKeep the source IP at L4 (no SNAT hop)
X-Forwarded-For / ForwardedClient IP carried in HTTP headers by L7 proxies
PROXY protocol v1/v2Client IP prepended to the TCP stream by L4 proxies