Skip to main content
Welcome to this hands-on demo where we explore the Kubernetes networking model. You’ll learn how containers within the same Pod share network namespaces, how Pods communicate across the cluster, and how the CNI plugin sets up virtual interfaces.

Environment Setup

In the default namespace, we’ve deployed two Pods:

Inspecting Pods

Describe pod1

Describe pod2


Exploring Network Namespaces on the Node

First, SSH into the node where these Pods are running:
List all PID-based namespaces:
You’ll see entries for CNI “pause” containers and each workload container:
Identify the network namespace for a specific PID (e.g., 6933):
The cni-… prefix indicates creation by the CNI plugin.

Host Network Interfaces

On the node, view all interfaces:
Filter for virtual Ethernet pairs (veth) created by CNI:
Each veth pair connects a Pod’s network namespace to the host or overlay network.

Inspecting a Pod’s Network Namespace

  1. Map container PIDs to namespaces:
  2. Inspect one namespace’s network interfaces:

Verifying Shared Network Namespace in pod1

Both container1 and container2 share the same network namespace and IP address.

Intra-Pod Communication

From container1, fetch the NGINX welcome page over localhost:

Pod-to-Pod Communication

Retrieve all Pod IPs in the default namespace:
From pod1, connect to the NGINX server on pod2:
This confirms cluster-wide Pod-to-Pod connectivity, a core requirement of the Kubernetes networking model.

References

Watch Video