$linuxjunkies
>

crictl(1)

crictl is a command-line interface for interacting with container runtimes that implement the Kubernetes Container Runtime Interface (CRI).

UbuntuDebianFedoraArch

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

FlagWhat it does
-r, --runtime-endpointendpoint of CRI container runtime service socket (default: unix:///run/containerd/containerd.sock)
-i, --image-endpointendpoint of CRI image service socket (optional, usually same as runtime endpoint)
-t, --timeouttimeout for each API call in seconds (default: 2s)
-d, --debugenable debug output
-v, --versionprint crictl version and exit
-h, --helpshow help message

Examples

list all running containers

crictl ps

list all containers including stopped ones

crictl ps -a

fetch logs from a specific container

crictl logs <container-id>

run an interactive bash shell inside a running container

crictl exec -it <container-id> /bin/bash

list all container images available on the node

crictl images

display detailed information about a specific container

crictl inspect <container-id>

list all pods managed by the container runtime

crictl pods

show resource usage statistics for running containers

crictl stats

Related commands