crictl

CRI-compatible container runtime CLI

TLDR

List containers
$ crictl ps
List all containers including stopped
$ crictl ps -a
List images
$ crictl images
Pull image
$ crictl pull [image:tag]
Run pod from config
$ crictl runp [pod.json]
Create container
$ crictl create [pod-id] [container.json] [pod.json]
Start container
$ crictl start [container-id]
Execute command in container
$ crictl exec -it [container-id] [/bin/sh]
View container logs
$ crictl logs [container-id]
Remove container
$ crictl rm [container-id]
Stop and remove pod
$ crictl stopp [pod-id] && crictl rmp [pod-id]

SYNOPSIS

crictl [globaloptions] command [options] [arguments_]

DESCRIPTION

crictl is a command-line interface for CRI-compatible container runtimes. CRI (Container Runtime Interface) is the plugin interface that enables Kubernetes to work with different container runtimes. crictl provides debugging and inspection tools for Kubernetes nodes, interacting directly with containerd, CRI-O, or other CRI-compliant runtimes.Unlike docker or podman which are designed for general container management, crictl is specifically built for Kubernetes troubleshooting. It exposes the CRI API operations, allowing cluster administrators to inspect pod sandboxes, containers, and images as they exist in the CRI runtime layer, helping diagnose issues with pod scheduling, container creation, and image pulling.

PARAMETERS

-r, --runtime-endpoint endpoint

CRI runtime endpoint (e.g., unix:///run/containerd/containerd.sock).
-i, --image-endpoint endpoint
CRI image endpoint.
--timeout duration
Connection timeout in seconds (default: 2).
--config path
Location of the client config file (default: /etc/crictl.yaml).
-D, --debug
Enable debug output.

CONFIGURATION

~/.crictl.yaml or /etc/crictl.yaml

$ runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false

COMMANDS

ps

List containers
pods
List pods
images
List images
pull
Pull image
run
Run a new container
exec
Execute command in container
logs
View container logs
attach
Attach to container
start/stop
Start/stop container
rm
Remove container
rmi
Remove image
runp/stopp/rmp
Run/stop/remove pod
inspect
Inspect container
inspecti
Inspect image
inspectp
Inspect pod
stats
Container resource usage
info
Runtime info

INSTALL

sudo dnf install cri-tools
sudo pacman -S crictl
sudo apk add cri-tools
sudo zypper install cri-tools
brew install cri-tools
nix profile install nixpkgs#cri-tools

CAVEATS

Must run with appropriate privileges (typically root). Command syntax differs from docker CLI. Primarily for debugging Kubernetes nodes, not general container management. Command-line flags take precedence over environment variables, which take precedence over the config file.

HISTORY

crictl is part of the cri-tools project maintained by Kubernetes SIGs. It was created to provide a standard debugging and troubleshooting tool for CRI-compatible container runtimes, replacing runtime-specific CLIs for Kubernetes node inspection.

SEE ALSO

kubectl(1), ctr(1), podman(1), nerdctl(1)