2022-06-29 16:00:21 +08:00
|
|
|
# crictl
|
|
|
|
|
|
|
|
> Command-line for CRI-compatible container runtimes.
|
|
|
|
> More information: <https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md>.
|
|
|
|
|
|
|
|
- List all kubernetes pods (Ready and NotReady):
|
|
|
|
|
|
|
|
`crictl pods`
|
|
|
|
|
|
|
|
- List all containers (Running and Exited):
|
|
|
|
|
2025-04-12 15:42:06 +03:00
|
|
|
`crictl ps {{[-a|--all]}}`
|
2022-06-29 16:00:21 +08:00
|
|
|
|
|
|
|
- List all images:
|
|
|
|
|
|
|
|
`crictl images`
|
|
|
|
|
|
|
|
- Print information about specific containers:
|
|
|
|
|
|
|
|
`crictl inspect {{container_id1 container_id2 ...}}`
|
|
|
|
|
|
|
|
- Open a specific shell inside a running container:
|
|
|
|
|
2025-04-12 15:42:06 +03:00
|
|
|
`crictl exec {{[-it|--interactive --tty]}} {{container_id}} {{sh}}`
|
2022-06-29 16:00:21 +08:00
|
|
|
|
|
|
|
- Pull a specific image from a registry:
|
|
|
|
|
|
|
|
`crictl pull {{image:tag}}`
|
|
|
|
|
2025-04-12 15:42:06 +03:00
|
|
|
- Print and follow logs of a specific container:
|
2022-06-29 16:00:21 +08:00
|
|
|
|
2025-04-12 15:42:06 +03:00
|
|
|
`crictl logs {{[-f|--follow]}} {{container_id}}`
|
2022-06-29 16:00:21 +08:00
|
|
|
|
|
|
|
- Remove one or more images:
|
|
|
|
|
|
|
|
`crictl rmi {{image_id1 image_id2 ...}}`
|