Environment Setup
In the default namespace, we’ve deployed two Pods:| Pod | Containers | Description |
|---|---|---|
| pod1 | container1 (sleep), container2 (sleep), nginx (port 80) | Multi-container Pod |
| pod2 | nginx (port 80) | Single-container Pod |
Inspecting Pods
Describe pod1
Describe pod2
Exploring Network Namespaces on the Node
First, SSH into the node where these Pods are running:6933):
cni-… prefix indicates creation by the CNI plugin.
Host Network Interfaces
On the node, view all interfaces:veth) created by CNI:
veth pair connects a Pod’s network namespace to the host or overlay network.
Inspecting a Pod’s Network Namespace
-
Map container PIDs to namespaces:
-
Inspect one namespace’s network interfaces:
Verifying Shared Network Namespace in pod1
Bothcontainer1 and container2 share the same network namespace and IP address.
Intra-Pod Communication
Fromcontainer1, fetch the NGINX welcome page over localhost:
Pod-to-Pod Communication
Retrieve all Pod IPs in the default namespace:pod1, connect to the NGINX server on pod2: