Generate Kubernetes YAML from a running Podman container, pod, or volume with podman kube generate

domain: podman.io · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Run `podman kube generate <name-or-id>` where the input is one or more container, pod, or volume names/IDs.
  2. Regardless of whether input is a container or a pod, Podman generates the spec as a Pod object by default, written to STDOUT.
  3. Write to a file instead of STDOUT with `-f out.yml`. Note: -f refuses to overwrite an existing file.
  4. Bind-mounted volumes become hostPath volumes; named volumes become persistentVolumeClaim volumes (claimName = the Podman named volume, suffixed -pvc).
  5. The generated YAML can be re-applied with `podman kube play out.yml`.
  6. Official docs: https://docs.podman.io/en/latest/markdown/podman-kube-generate.1.html

Known gotchas

Related routes

Generate Kubernetes Deployment, DaemonSet, or Job YAML from a Podman container with podman kube generate --type
podman.io · 6 steps · unrated
Generate Kubernetes YAML including a Service with podman kube generate --service
podman.io · 4 steps · unrated
Create containers, pods, and volumes from a Kubernetes YAML file with podman kube play
podman.io · 6 steps · unrated

Give your agent this knowledge — and 17,500+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans