NAME¶ 名称
podman-pod-ps - Print out information about pods
podman-pod-ps - 打印有关 pod 的信息
SYNOPSIS¶ 概要
podman pod ps [options] podman pod ps [选项]
DESCRIPTION¶ 描述
podman pod ps lists the pods on the system.
By default it lists:
podman pod ps 列出系统上的 pods。默认情况下,它列出:
pod ID
pod name Pod 名称
the time the pod was created
Pod 创建时间number of containers attached to pod
附加到 Pod 的容器数量container ID of the pod infra container
Pod 基础设施容器的容器 IDstatus of pod as defined by the following table
Pod 的状态,由以下表格定义
Status |
Description |
---|---|
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
显示容器 ID
--ctr-names¶
Display the container names
显示容器名称
--ctr-status¶
Display the container statuses
显示容器状态
--filter, -f=filter¶ --filter, -f=过滤器 ¶
Provide filter values. 提供过滤器值。
The filters argument format is of key=value
. If there is more than one filter, then pass multiple OPTIONS: --filter foo=bar --filter bif=baz.
过滤器参数格式为 key=value
。如果有多个过滤器,则传递多个选项:--filter foo=bar --filter bif=baz。
Supported filters: 支持的过滤器:
Filter |
Description |
---|---|
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. 按 pod 名称过滤。 |
network |
Filter by network name or full ID of network. |
status |
Filter by pod status. 按 Pod 状态进行筛选。 |
until |
Filter by pods created before given timestamp. |
The ctr-ids
, ctr-names
, id
, name
filters accept regex
format.
ctr-ids
, ctr-names
, id
, name
过滤器接受 regex
格式。
The ctr-status
filter accepts values: created
, running
, paused
, stopped
, exited
, unknown
.
ctr-status
过滤器接受值: 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.
label
过滤器接受两种格式。一种是 label
=key 或 label
=key=value,用于移除具有指定标签的容器。另一种格式是 label!
=key 或 label!
=key=value,用于移除不具有指定标签的容器。
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.
until
过滤器可以是 Unix 时间戳、日期格式化的时间戳,或者是相对于机器时间计算的 Go 时长字符串(例如 10m,1h30m)。
The status
filter accepts values: stopped
, running
, paused
, exited
, dead
, created
, degraded
.
status
过滤器接受值: stopped
, running
, paused
, exited
, dead
, created
, degraded
。
--format=format¶
Pretty-print containers to JSON or using a Go template
将容器漂亮地打印成 JSON 或使用 Go 模板
Valid placeholders for the Go template are listed below:
Go 模板的有效占位符如下所示:
Placeholder |
Description |
---|---|
.Cgroup |
Cgroup path of pod Pod 的 Cgroup 路径 |
.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 Pod 的创建时间 |
.ID |
Container ID 容器 ID |
.InfraID |
Pod infra container ID Pod 基础设施容器 ID |
.Label string .标签字符串 |
Specified label of the pod |
.Labels … .标签 … |
All the labels assigned to the pod |
.Name |
Name of pod 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 Pod 的状态 |
--help, -h¶ --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)
显示最新创建的 Pod(所有状态)(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)机器)
--namespace, --ns¶
Display namespace information of the pod
显示 pod 的命名空间信息
--no-trunc¶
Do not truncate the output (default false).
不要截断输出(默认为 false)。
--noheading, -n¶ --noheading,-n ¶
Omit the table headings from the listing.
从列表中省略表头。
--quiet, -q¶
Print the numeric IDs of the pods only
仅打印 pod 的数字 ID
--sort¶ --sort
Sort by created, ID, name, status, or number of containers
按创建时间、ID、名称、状态或容器数量排序
Default: created 默认:创建时间
EXAMPLES¶ 示例
List all running pods.
列出所有正在运行的 Pod。
$ 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 running pods along with container names within the pods.
列出所有正在运行的 Pod 以及 Pod 中的容器名称。
$ 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 running pods along with status, names and ids.
列出所有正在运行的 Pod 以及状态、名称和 ID。
$ 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 running pods and print ID, Container Names, and cgroups.
列出所有正在运行的 Pod 并打印 ID、容器名称和 cgroups。
$ podman pod ps --format "{{.ID}} {{.ContainerNames}} {{.Cgroup}}"
00dfd6fa02c0 loving_archimedes /libpod_parent
f4df8692e116 thirsty_hawking,wizardly_golick /libpod_parent
List all running pods with two containers sorted by pod ID.
列出所有具有两个容器的正在运行的 Pod,并按 Pod ID 排序。
$ 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 running pods with their container ids.
列出所有具有其容器 ID 的正在运行的 Pod。
$ 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 running pods with container ids without truncating IDs.
列出所有具有容器 ID 的正在运行的 Pod,而不截断 ID。
$ 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 running pods with container names.
列出所有具有容器名称的运行中的 Pod。
$ 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 ...
pod ps¶
Print a list of pods
打印一个 Pod 列表
SEE ALSO¶ 参见 ¶
HISTORY¶ 历史 ¶
July 2018, Originally compiled by Peter Hunt pehunt@redhat.com
2018 年 7 月,最初由 Peter Hunt pehunt@redhat.com 编译