podman-pod-ps(1)

πŸ¦‹ podman-pod-ps(1) πŸ¦‹

okay bestie, welcome to podman-pod-ps(1) from the General Commands Manual β€” this is the page about printing out info about pods, and we're gonna make it make sense. periodt. πŸ’…


πŸ’– NAME πŸ’–

podman-pod-ps β€” Print out information about pods ✨

πŸŽ€ SYNOPSIS πŸŽ€

podman pod ps [options]

🌸 DESCRIPTION 🌸

podman pod ps lists all pods on the system. By default it lists:

  • pod ID
  • pod name
  • the time the pod was created
  • number of containers attached to pod
  • container ID of the pod infra container
  • status of pod as defined by the following table (we're doing it as a bullet list, but the tea is identical 🍡)

Here's the status rundown, no cap:

  • Created β€” No containers running nor stopped
  • Running β€” at least one container is running
  • Stopped β€” At least one container stopped and none running
  • Exited β€” All containers stopped in pod
  • Dead β€” Error retrieving state

✨ OPTIONS ✨

  • --ctr-ids β€” Display the container IDs
  • --ctr-names β€” Display the container names
  • --ctr-status β€” Display the container statuses
  • --filter, -f=filter β€” Provide filter values.

If there is more than one filter, the --filter option should be passed multiple times: --filter label=test --filter until=10m.

Supported filters:

  • ctr-ids β€” Filter by container ID within the pod. (CID prefix match by default; accepts regex)
  • ctr-names β€” Filter by container name within the pod.
  • ctr-number β€” Filter by number of containers in the pod.
  • ctr-status β€” Filter by container status within the pod.
  • id β€” Filter by pod ID. (Prefix match by default; accepts regex)
  • label β€” Filter by container with (or without, in the case of label!=[...] is used) the specified labels.
  • name β€” Filter by pod name.
  • network β€” Filter by network name or full ID of network.
  • status β€” Filter by pod status.
  • until β€” Filter by pods created before given timestamp.

The ctr-ids, ctr-names, id, name filters accept regex format.

The ctr-status filter accepts values: created, running, paused, stopped, exited, unknown.

The label filter accepts two formats. One is the label=key or label=key=value, which removes containers with the specified labels. The other format is the label!=key or label!=key=value, which removes containers without the specified labels.

The until filter can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machine's time.

The status filter accepts values: stopped, running, paused, exited, dead, created, degraded.

  • --format=format β€” Pretty-print containers to JSON or using a Go template

Valid placeholders for the Go template are listed below:

  • .Cgroup β€” Cgroup path of pod
  • .ContainerIds β€” Comma-separated list of container IDs in the pod
  • .ContainerNames β€” Comma-separated list of container names in the pod
  • .ContainerStatuses β€” Comma-separated list of container statuses
  • .Created β€” Creation time of pod
  • .ID β€” Container ID
  • .InfraID β€” Pod infra container ID
  • .Label string β€” Specified label of the pod
  • .Labels β€” All the labels assigned to the pod
  • .Name β€” Name of pod
  • .Networks β€” Show all networks connected to the infra container
  • .NumberOfContainers β€” Show the number of containers attached to pod
  • .Restarts β€” Show the total number of container restarts in a pod
  • .Status β€” Status of pod
  • --help, -h β€” Print usage statement
  • --latest, -l β€” Show the latest pod created (all states) (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
  • --namespace, --ns β€” Display namespace information of the pod
  • --no-trunc β€” Do not truncate the output (default false).
  • --noheading, -n β€” Omit the table headings from the listing.
  • --quiet, -q β€” Print the numeric IDs of the pods only
  • --sort β€” Sort by created, ID, name, status, or number of containers

Default: created

✨ EXAMPLES ✨

okay bestie, this is the fun part β€” receipts. every single example is right here, commands and output exactly as the page says, no edits, no cap. πŸ’…


List all pods. the classic starter pack β€” no flags, just the whole pod roster:

$ podman pod ps
POD ID         NAME              STATUS    CREATED          INFRA ID       # OF CONTAINERS
00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   1
f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   2

List all pods along with container names within the pods. now we're peeking inside the pods too:

$ podman pod ps --ctr-names
POD ID         NAME              STATUS    CREATED          INFRA ID       NAMES
00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   loving_archimedes
f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   thirsty_hawking,wizardly_golick

List all pods along with status, names and ids. full main-character energy β€” status, names, and ids all up in the mix:

$ podman pod ps --ctr-status --ctr-names --ctr-ids
POD ID         NAME              STATUS    CREATED          INFRA ID       IDS                         NAMES                             STATUS
00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   ba465ab0a3a4                loving_archimedes                 running
f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   331693bff40a,8e428daeb89e   thirsty_hawking,wizardly_golick   configured,configured

List all pods and print ID, Container Names, and cgroups. custom --format moment β€” you pick the columns, you run the world:

$ podman pod ps --format "{{.ID}}  {{.ContainerNames}}  {{.Cgroup}}"
00dfd6fa02c0   loving_archimedes   /libpod_parent
f4df8692e116   thirsty_hawking,wizardly_golick   /libpod_parent

List all pods with two containers sorted by pod ID. filter + sort combo, lowkey iconic:

$ podman pod ps --sort id --filter ctr-number=2
POD ID         NAME             STATUS    CREATED          INFRA ID       # OF CONTAINERS
f4df8692e116   nifty_torvalds   Created   10 minutes ago   331693bff40a   2

List all pods with their container ids. the --ctr-ids serve:

$ podman pod ps  --ctr-ids
POD ID         NAME              STATUS    CREATED          INFRA ID       IDS
00dfd6fa02c0   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4   ba465ab0a3a4
f4df8692e116   nifty_torvalds    Created   10 minutes ago   331693bff40a   331693bff40a,8e428daeb89e

List all pods with container ids without truncating IDs. no shortening, no hiding β€” full ids only:

$ podman pod ps --no-trunc --ctr-ids
POD ID                                                             NAME              STATUS    CREATED          INFRA ID                                                           IDS
00dfd6fa02c0a2daaedfdf8fcecd06f22ad114d46d167d71777224735f701866   jolly_goldstine   Running   31 hours ago     ba465ab0a3a4e15e3539a1e79c32d1213a02b0989371e274f98e0f1ae9de7050   ba465ab0a3a4e15e3539a1e79c32d1213a02b0989371e274f98e0f1ae9de7050
f4df8692e116a3e6d1d62572644ed36ca475d933808cc3c93435c45aa139314b   nifty_torvalds    Created   10 minutes ago   331693bff40a926b6d52b184e116afd15497610c378d5d4c42945dd6e33b75b0   331693bff40a926b6d52b184e116afd15497610c378d5d4c42945dd6e33b75b0,8e428daeb89e69b71e7916a13accfb87d122889442b5c05c2d99cf94a3230e9d

List all pods with container names. this one has a whole little friend group in the NAMES column:

$ podman pod ps --ctr-names
POD ID         NAME   STATUS    CREATED        INFRA ID       NAMES
314f4da82d74   hi     Created   17 hours ago   a9f2d2165675   jovial_jackson,hopeful_archimedes,vibrant_ptolemy,heuristic_jennings,keen_raman,hopeful_newton,mystifying_bose,silly_lalande,serene_lichterman ...

List pods containing the specified container ID. hunting down one specific container id like it's a crush's finsta:

$ podman pod ps --filter ctr-ids=aceb3b775797
POD ID        NAME        STATUS      CREATED        INFRA ID      # OF CONTAINERS
952330c7cff0  web-app     Running     3 minutes ago  b0f247c49669  3

List all pods with exactly 2 containers. not one, not three β€” exactly two, periodt:

$ podman pod ps --filter ctr-number=2
POD ID        NAME         STATUS      CREATED        INFRA ID      # OF CONTAINERS
b2ae050d17be  labeled-pod  Running     2 minutes ago  fda2a486b939  2

List pods with containers in exited status. catching the ones that already left the chat:

$ podman pod ps --filter ctr-status=exited
POD ID        NAME         STATUS      CREATED        INFRA ID      # OF CONTAINERS
06c3a107763a  maintenance  Degraded    4 minutes ago  67e500cbb678  3
1e3424d7e9c0  db-cluster   Degraded    4 minutes ago  d6650a490b69  3

Filter pod by ID. when you know the exact id and you're not settling:

$ podman pod ps --filter id=95938982244d
POD ID        NAME        STATUS      CREATED        INFRA ID      # OF CONTAINERS
95938982244d  nettest     Running     4 minutes ago  a28d133e8c63  3

Filter pod by label. label girlies rise:

$ podman pod ps --filter label=tier=frontend
POD ID        NAME         STATUS      CREATED       INFRA ID      # OF CONTAINERS
b2ae050d17be  labeled-pod  Running     1 second ago  fda2a486b939  2

Filter pod by name. name-based search, cute and direct:

$ podman pod ps --filter name=db-cluster
POD ID        NAME        STATUS      CREATED        INFRA ID      # OF CONTAINERS
1e3424d7e9c0  db-cluster  Degraded    4 minutes ago  d6650a490b69  3

Filter pod by pod status (e.g., Degraded). the degraded filter, doing its dramatic little thing:

$ podman pod ps --filter status=degraded
POD ID        NAME         STATUS      CREATED        INFRA ID      # OF CONTAINERS
95938982244d  nettest      Degraded    7 minutes ago  a28d133e8c63  3
06c3a107763a  maintenance  Degraded    8 minutes ago  67e500cbb678  3
1e3424d7e9c0  db-cluster   Degraded    8 minutes ago  d6650a490b69  3
952330c7cff0  web-app      Degraded    8 minutes ago  b0f247c49669  3

Filter pods created before a time threshold (--until). time-travel-ish filtering, but make it 2m:

$ podman pod ps --filter until=2m
POD ID        NAME         STATUS      CREATED        INFRA ID      # OF CONTAINERS
b2ae050d17be  labeled-pod  Running     3 minutes ago  fda2a486b939  2
95938982244d  nettest      Degraded    8 minutes ago  a28d133e8c63  3
deee8956522e  utility      Running     8 minutes ago  6b730e3ac334  3
06c3a107763a  maintenance  Degraded    8 minutes ago  67e500cbb678  3
1e3424d7e9c0  db-cluster   Degraded    8 minutes ago  d6650a490b69  3
952330c7cff0  web-app      Degraded    8 minutes ago  b0f247c49669  3

πŸŽ€ pod ps

Print a list of pods. that's the whole assignment, bestie β€” print the pods, collect the clout. πŸ’…


πŸ‘€ SEE ALSO

podman(1), podman-pod(1)


πŸ“œ HISTORY

July 2018, Originally compiled by Peter Hunt pehunt@redhat.com ⟨mailto:pehunt@redhat.com⟩


and that's the page, bestie β€” footer says podman-pod-ps(1), history is stamped July 2018, and we are officially done. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from