Kubernetes Networking
Objective
Understand Kubernetes networking model, CNI, and NetworkPolicies.
Tools & Technologies
CNIkube-proxyNetworkPolicyCalico
Key Commands
kubectl apply -f network-policy.yamlkubectl get networkpolicieskubectl exec -it pod1 -- curl pod2-ip:8080kubectl get endpointsLab Steps
01
CNI Concepts
Understand how Container Network Interface plugins enable pod networking.
02
Pod-to-Pod Communication
Verify direct pod-to-pod communication across nodes.
03
NetworkPolicies
Write NetworkPolicies to restrict pod communication.
04
Service Mesh Intro
Explore basic service mesh concepts with Istio or Linkerd.
Challenges Encountered
- NetworkPolicy requires CNI that supports it (Calico, Cilium)
- Default-deny policies block all traffic including DNS
Key Takeaways
- NetworkPolicies are additive — multiple policies are OR'd together
- Include a default-deny policy then explicitly allow required traffic