Podman Pods and Infra Containers
`podman pod inspect` answers the question directly: `shared=[uts ipc net]`. Two containers in a pod share one hostname and one IP, and still cannot see each other's processes or files.
Pods Guide 11 of 47 Beginner
- OSUbuntu 26.04 LTS (resolute)
- Podman5.7.0
- Runtimecrun 1.21
- Networknetavark 1.16.1
- TimeAbout 13 min
- Reviewed22 August 2026
Written against the versions above. Podman follows the distribution here rather than a vendor repository, so the version you get is the one Ubuntu shipped. The commands are stable across 5.x.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| PODMAN01 | 192.168.0.24 | Ubuntu 26.04 LTS | Primary Container Host | 2 Core | 4 GB | 50 GB |
Before you start
- Podman installed - see guide 1.
- guide 2 is worth reading first: a pod adds one more container to the process picture, and it helps to know what that picture looked like before.
-
Create an empty pod and count the containers
A pod with nothing in it is not empty. Create one, then list containers.
There is already one - named
,-infra Created, running nothing visible.podman pod psreports# OF CONTAINERS: 1before you have added any.This is the infra container, and it is the whole mechanism. It exists to hold a set of namespaces open. Containers you add later do not create namespaces of their own for the shared ones - they join this container's.
bash Example session podman pod create --name demo395e6c497abb01047486848cb993360471eb992b3ce5b0a41375e86b6a11462bpodman pod psPOD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS395e6c497abb demo Created Less than a second ago cab9c5ff3ef5 1podman ps -a --podCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES POD ID PODNAMEcab9c5ff3ef5 Less than a second ago Created 395e6c497abb-infra 395e6c497abb demoExpected resultA pod in state
Createdwith one container, which you did not add.Success conditionYou can name the container that exists in a pod you have put nothing into.
-
Ask which namespaces are shared
Do not infer this from the Kubernetes documentation - ask the pod:
shared=[uts ipc net]Three, and it is worth being precise about each:
- uts - the hostname. Every container in the pod answers
hostnamewith the pod's name. - ipc - System V IPC and POSIX message queues. Shared memory between containers works.
- net - one network namespace. One IP address, one set of interfaces, one port space, one loopback.
What is not in that list matters just as much:
pidandmnt. Processes and filesystems stay private. If you have carried over an assumption from Kubernetes that pod containers can see each other's processes, this is where to correct it - there it is opt-in too.bash Example session podman pod inspect demo --format 'infra={{.InfraContainerID}}'infra=cab9c5ff3ef5f39daf8db290857e9477c8593e67b84e3ccf1032c78138c5b77apodman inspect $(podman pod inspect demo --format '{{.InfraContainerID}}') --format 'image={{.ImageName}} cmd={{.Config.Cmd}}'image= cmd=[]podman pod inspect demo --format 'shared={{.SharedNamespaces}}'shared=[uts ipc net]Expected result
shared=[uts ipc net], and an infra container with no user image.Success conditionYou have the list of shared namespaces from the pod itself, not from memory.
- uts - the hostname. Every container in the pod answers
-
Two containers, one network and one hostname
Add two containers to the pod and ask each what its address and hostname are.
The answers are identical. Same
eth0, same IP, same hostnamedemo. Not similar - the same, because there is one network namespace and one UTS namespace between them.One detail that surprises people arriving from Docker: the address is
192.168.0.24/24, which is the host's own LAN address, not a private172.17.x.x. That is rootless networking, where by default the container's interface mirrors the host's rather than sitting behind a bridge. It has its own guide in the Networking track; for now, just note that the two containers agree.bash Example session podman run -d --pod demo --name alpha docker.io/library/alpine sleep 3006e1c21381610c4bbbd2ee23273c37e1b8514408b32a40ee2d4856c8b606b7b94podman run -d --pod demo --name beta docker.io/library/alpine sleep 3007e3f1d03320c152f5baa3afac820a84301b576c742fa4e1bc3f9dcdad5cc84c3podman pod psPOD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS395e6c497abb demo Created Less than a second ago cab9c5ff3ef5 1podman exec alpha ip -o addr show eth02: eth0 inet 192.168.0.24/24 brd 192.168.0.255 scope global eth0\ valid_lft forever preferred_lft forever2: eth0 inet6 fe80::c8dd:a1ff:fe31:e9fc/64 scope link flags 02 \ valid_lft forever preferred_lft foreverpodman exec beta ip -o addr show eth02: eth0 inet 192.168.0.24/24 brd 192.168.0.255 scope global eth0\ valid_lft forever preferred_lft forever2: eth0 inet6 fe80::c8dd:a1ff:fe31:e9fc/64 scope link flags 02 \ valid_lft forever preferred_lft foreverpodman exec alpha hostnamedemopodman exec beta hostnamedemoExpected resultThree containers in the pod, and two containers reporting the same address and the same hostname.
Success conditionTwo containers give byte-identical answers about the network they are on.
-
Now prove what is not shared
The same two containers, asked about processes and files.
Processes: each sees
PID 1running its ownsleep. Two different processes, both numbered 1, because each container has its own PID namespace. Neither can see the other's.Files: write a file to
/tmpinalpha, then list/tmpinbeta. It is empty. The mount namespace is private, so/tmpis a different directory in each container despite the shared network.This is the accurate mental model, and it is narrower than most people assume: a pod is a shared network identity, not a shared machine. Containers in a pod talk over localhost, not over the filesystem. If two containers need to share files, they need a volume - the pod does not give them one.
bash Example session podman exec alpha ps -eo pid,commPID COMMAND 1 sleep 4 pspodman exec beta ps -eo pid,commPID COMMAND 1 sleep 4 pspodman exec alpha sh -c 'echo hello > /tmp/from-alpha; ls /tmp'from-alphapodman exec beta ls /tmppodman pod rm -f demotime="2026-08-22T11:02:57Z" level=warning msg="StopSignal SIGTERM failed to stop container alpha in 10 seconds, resorting to SIGKILL"time="2026-08-22T11:02:57Z" level=warning msg="StopSignal SIGTERM failed to stop container beta in 10 seconds, resorting to SIGKILL"395e6c497abb01047486848cb993360471eb992b3ce5b0a41375e86b6a11462bExpected resultTwo separate PID 1s, and a file visible in one container and absent in the other.
Success conditionYou can state what a pod shares and what it does not, having tested both.
Troubleshooting
podman pod rmfails withpod has containers that are not ready to be removed.Why: Containers in the pod are still running. Removing a pod does not stop them first unless you say so.
Fix:
podman pod rm -f demo, orpodman pod stop demothenpodman pod rm demoif you want a graceful shutdown.podman exec alpha ip -brief addrprints a BusyBox usage dump and exits 1.Why: Alpine's
ipis BusyBox, which has no--brief. Nothing is wrong with the container.Fix:Use
ip -o addr show eth0, which BusyBox does support, or run the same check from an image with full iproute2.Two containers in a pod cannot see each other's processes and you expected them to.
Why:
pidis not in the shared list. It is not shared by default here, and it is not shared by default in Kubernetes either.Fix:
podman pod create --share pid,uts,ipc,net. Be deliberate about it - sharing the PID namespace means one container can signal another's processes.