Calico Pod Communication
Before any traffic moves, Calico and Kubernetes set up the landscape:
veth Pairs: For every Pod created, Calico creates a virtual ethernet cable. One end sits in the Pod's network namespace; the other end sits in the host namespace (named caliXXXXX).Felix) pre-populates the Linux kernel’s native routing table (ip route). It writes rules mapping every Pod IP to its specific caliXXXXX interface.cali- and KUBE-) directly into the kernel's native Netfilter hooks.When a packet travels from Pod 1 to a Service VIP, it triggers Netfilter hooks and routing decisions in a strict, unchangeable timeline:
cali-PREROUTING chain. It inspects the packet after DNAT and applies Ingress Network Policies.caliXXXXX for same-host, or a physical NIC like eth0 for cross-host).FORWARD hook.cali-FORWARD chain to validate transit safety.cali-POSTROUTING chain to enforce Egress Network Policies.
[ Packet Leaves Pod 1 via veth ] ──► Enters Host Namespace
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ KERNEL HOOKS & CALICO INTERACTION │
│ │
│ 1. PREROUTING HOOK │
│ ├──► kube-proxy: DNAT (VIP ──► Real Pod 2 IP) │
│ └──► Calico: Checks Ingress Policy ──► [ALLOW / DROP] │
│ │
│ 2. ROUTING DECISION │
│ └──► Linux Kernel: Reads Calico's pre-written routing table │
│ └──► Destination matched ──► Target Interface locked in │
│ │
│ 3. FORWARD HOOK │
│ └──► Calico: Checks Transit/Inter-pod Policy ──► [ALLOW / DROP] │
│ │
│ 4. POSTROUTING HOOK │
│ ├──► Calico: Checks Egress Policy ──► [ALLOW / DROP] │
│ └──► kube-proxy/Calico: Applies SNAT (only if traffic leaves node/cluster) │
└─────────────────────────────────────────────────────────────────────────────────1
│
▼
[ Packet Enters Target veth ] ──► Arrives safely at Pod 2!
Now that you have the complete summary, where would you like to go next?