crictl(1)
crictl is a command-line interface for interacting with container runtimes that implement the Kubernetes Container Runtime Interface (CRI).
Synopsis
crictl [OPTIONS] COMMAND [ARG...]Description
crictl is a CLI tool for debugging and managing containers and images on Kubernetes nodes. It communicates with CRI-compatible container runtimes like containerd, CRI-O, and Docker via the Container Runtime Interface socket, allowing inspection and manipulation of containers, pods, and images without relying on docker or podman commands.
crictl is essential for Kubernetes administrators and developers who need to troubleshoot container issues, inspect running containers, manage images, and debug pod problems directly on cluster nodes. It provides a standardized interface across different container runtime implementations.
Common options
| Flag | What it does |
|---|---|
-r, --runtime-endpoint | endpoint of CRI container runtime service socket (default: unix:///run/containerd/containerd.sock) |
-i, --image-endpoint | endpoint of CRI image service socket (optional, usually same as runtime endpoint) |
-t, --timeout | timeout for each API call in seconds (default: 2s) |
-d, --debug | enable debug output |
-v, --version | print crictl version and exit |
-h, --help | show help message |
Examples
list all running containers
crictl pslist all containers including stopped ones
crictl ps -afetch logs from a specific container
crictl logs <container-id>run an interactive bash shell inside a running container
crictl exec -it <container-id> /bin/bashlist all container images available on the node
crictl imagesdisplay detailed information about a specific container
crictl inspect <container-id>list all pods managed by the container runtime
crictl podsshow resource usage statistics for running containers
crictl stats