Running Kubernetes YAML with Podman
`podman kube play` runs a Kubernetes manifest on a single host with no cluster, no kubelet and no API server. `podman kube down` then prints a netns error and exits 0 - the pod is gone, and the same pod built by hand tears down silently.
Pods Guide 14 of 47 Intermediate
- OSUbuntu 26.04 LTS (resolute)
- Podman5.7.0
- Runtimecrun 1.21
- Networknetavark 1.16.1
- TimeAbout 15 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
- A manifest on disk. guide 22 produces the
shop.yamlused here.
-
Play it back
One command, and the pod exists again. No cluster was involved - there is no API server, no scheduler and no kubelet on this machine.
kube playreads the manifest, creates a pod, and creates one container perspec.containersentry. What it prints is the pod ID followed by a container ID for each.bash Example session podman kube play shop.yamlPod:91a48f41701aea32709524af38796565f8aa865927d027cfad7f322e337134b2Containers:edd8357786aef2751997b473b79cb2b72e09d839668be44fafabca933af07cef5d392f6ec1f390b903dc58dd1d364d6a8b719829d49ffbc74fccc23b9c476ccfpodman pod psPOD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS4194fc9eb7f9 shop Running 15 seconds ago 2d5e8d85ede5 3Expected resultA pod ID and two container IDs, then a running pod with three containers.
Success conditionA Kubernetes manifest is running on a host with no Kubernetes.
-
The names changed
This is the detail that breaks scripts, so it is worth seeing before it costs you anything.
The manifest says
storefrontandcache. The running containers areshop-storefrontandshop-cache- the pod name, a hyphen, then the container name.Podman needs container names to be unique across the whole host, while a manifest only needs them unique within the pod. Prefixing is how it reconciles the two. So the round trip is not symmetric:
kube generatestrips the prefix andkube playadds it back. Anything addressing a container by name - apodman execin a script, a log collector - has to use the prefixed form.And it genuinely serves traffic. The
hostPortfrom the manifest is published, socurlon the host reaches nginx.bash Example session podman ps --pod --format 'table {{.Names}} {{.Image}} {{.Status}}'NAMES IMAGE STATUS91a48f41701a-infra Up 1 secondshop-storefront docker.io/library/nginx:alpine Up 1 secondshop-cache docker.io/library/redis:alpine Up 1 secondcurl -s -o /dev/null -w 'http=%{http_code}\n' http://localhost:8090http=200Expected result
shop-storefrontandshop-cacherunning, andhttp=200from the host.Success conditionYou know the running name of a container the manifest called something else.
-
Tear it down, and read the error carefully
podman kube down shop.yamlremoves the pod. It also prints this:Pods stopped: Error: stopping container a5cb6d4e001b...: removing container ... network: 1 error occurred: * rootless netns: kill network process: permission denied Pods removed: b3063debdee5...Three things about it, in order of what matters:
- The teardown worked.
Pods removedlists the pod, andpodman pod psis empty afterwards. - The exit code is 0. The word
Errorappears in output that reports success, so a script checking$?sees a clean run while a human reading the terminal sees a failure. If you wrap this in CI, check the exit code and not the output. - It is not your fault and not intermittent. Podman failed to signal the helper process that holds the rootless network namespace, then removed everything anyway.
This was reproduced on every attempt - three consecutive cycles on a freshly rebooted host with lingering disabled, and again here.
bash Example session podman kube down shop.yamlPods stopped:Error: stopping container a5cb6d4e001ba8035d2f3eee8e8fa777d00135c9589b7dc5e59b1ac621fe4574: removing container a5cb6d4e001ba8035d2f3eee8e8fa777d00135c9589b7dc5e59b1ac621fe4574 network: 1 error occurred: * rootless netns: kill network process: permission denied Pods removed:b3063debdee5129b9960376fa8cc4c0aacfcd7cc45fb131bffbdf05eb32159b3Secrets removed:Volumes removed:echo "exit code was $?"exit code was 0podman pod psPOD ID NAME STATUS CREATED INFRA ID # OF CONTAINERSExpected resultAn
Error:line naming the netns process, a populatedPods removed, exit code 0, and no pods left.Success conditionThe pod is gone and you are not chasing the error message.
- The teardown worked.
-
Prove where the fault lies
The useful question is whether that error is about pods, about published ports, or about
kube downspecifically. Build the same thing by hand and tear it down the ordinary way.Same shape: a pod with a published port, an nginx and a redis.
podman pod rm -f twinprints one line, the pod ID, and nothing else.So the message belongs to the
kube downpath. Pods are fine, published ports are fine, and the ordinary teardown is silent. Practical guidance: usekube playfreely, and if the noise fromkube downmatters to you - in a pipeline, or in a demo -podman pod rm -fremoves a played pod just as completely, without the message.This is worth doing as a habit rather than as a one-off. An error you cannot act on is worth ten minutes of bisecting, because the alternative is learning to ignore error output.
bash Example session podman pod create --name twin -p 8097:80fbe4ad83cb00d73d2b17ddf0f25ae039cacb0cbab48bf31430144935c08fbf54podman run -d --pod twin --name t1 docker.io/library/nginx:alpine692c30317c1b97d804c30a81da6926c7c5fabe68e60f01d67b6fce379cda1c0dpodman run -d --pod twin --name t2 docker.io/library/redis:alpine3d1ba7b532b5ae71dc3e0cd853579b946b7e4b1687c29b5cc2625163813a16acpodman pod rm -f twinfbe4ad83cb00d73d2b17ddf0f25ae039cacb0cbab48bf31430144935c08fbf54Expected resultA pod ID and nothing else from
podman pod rm -f.Success conditionYou have narrowed the error to one command by changing one thing at a time.
Troubleshooting
Error: pod already existsfromkube play.Why: A pod of that name is already running, from an earlier play or built by hand.
Fix:
podman kube down shop.yamlfirst, orpodman kube play --replace shop.yamlto tear down and recreate in one step.podman exec storefront ...reports no such container.Why: The running name is prefixed with the pod name.
Fix:
podman ps --podshows the real names. Useshop-storefront.The
rootless netns: kill network process: permission deniederror worries you.Why: Podman could not signal the process holding the shared rootless network namespace. The removal proceeds regardless.
Fix:Confirm with
podman pod psthat nothing is left, and check$?rather than the text - it is 0. Usepodman pod rm -f <pod>if you need silent teardown.curlto the host port fails after a successful play.Why: The manifest may carry no
hostPort, in which case nothing is published - acontainerPorton its own publishes nothing, exactly as in Kubernetes.Fix:
podman port -alists what is actually published. Add ahostPortto the manifest, or publish at play time with--publish.