This folder contains information and tools for debugging Kubernetes networking issues.
-
Check Pod Networking:
- Use
kubectl get pods -o wideto view pod IPs. - Use
pingorcurlto test connectivity between pods.
- Use
-
Inspect Network Policies:
- Use
kubectl get networkpolicyto list network policies. - Verify that policies are not blocking traffic.
- Use
-
Verify CNI Plugin:
- Check logs of the CNI plugin pods (e.g.,
kubectl logs -n kube-system <cni-pod-name>).
- Check logs of the CNI plugin pods (e.g.,
-
Inspect Node Networking:
- Use
ifconfigorip aon nodes to check network interfaces. - Use
iptablesto inspect firewall rules.
- Use
-
Inspect Configuration:
- Review the CNI plugin configuration file (e.g.,
/etc/cni/net.d/).
- Review the CNI plugin configuration file (e.g.,
kubectl- Network tools like
ping,curl,traceroute. - Node tools like
ifconfig,ip a,iptables.
Problem: Pods cannot communicate with each other.
Solution:
- Check pod IPs:
kubectl get pods -o wide. - Test connectivity:
ping <pod-ip>orcurl http://<pod-ip>:<port>. - Inspect network policies:
kubectl get networkpolicy. - Verify CNI plugin logs:
kubectl logs -n kube-system <cni-pod-name>.