Cloud Native 4 min read

Understanding Pod Communication and Calico Networking Modes in Kubernetes

This article explains how containers communicate within a pod, between pods, and with services in Kubernetes, and compares Calico's IPIP and BGP networking modes, detailing their traffic handling, suitable scenarios, efficiency, and configuration steps.

Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Understanding Pod Communication and Calico Networking Modes in Kubernetes

In Kubernetes, container communication follows several patterns:

Intra‑pod communication : multiple containers inside the same pod communicate via the loopback interface ( lo).

Pod‑to‑pod communication : pods talk directly using their pod IPs; no translation is required.

Pod‑to‑service communication : a pod accesses a service through the service’s cluster IP, which forwards traffic to the target pod IP via iptables or ipvs.

Service‑to‑external communication : services expose endpoints outside the cluster (details omitted).

Kubernetes networking diagram
Kubernetes networking diagram

Calico IPIP Network

The IPIP mode encapsulates traffic in a tunl0 device, creating a tunnel that carries packets across different subnet ranges. It is suitable when pods that need to communicate reside in separate subnets, solving cross‑subnet routing issues. The encapsulation adds overhead, so efficiency is slightly lower.

IPIP connection diagram
IPIP connection diagram

Calico BGP Network

When Calico is installed, the default network mode is IPIP. To switch to BGP, edit calico.yaml and set CALICO_IPV4POOL_IPIP to off. BGP uses routing information to direct traffic, making it ideal for pods within the same subnet or large‑scale networks. It operates with native host‑gateway routing, offering higher efficiency.

BGP configuration diagram
BGP configuration diagram
BGP connection diagram
BGP connection diagram
cloud-nativeKubernetesBGPIPIPPod CommunicationService networking
Full-Stack DevOps & Kubernetes
Written by

Full-Stack DevOps & Kubernetes

Focused on sharing DevOps, Kubernetes, Linux, Docker, Istio, microservices, Spring Cloud, Python, Go, databases, Nginx, Tomcat, cloud computing, and related technologies.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.