Containers

crictl CLI

crictl commands for CRI container runtime debugging.

31 commands
Windows MacOS Linux
#container-runtime #debugging

Pod Management

List all pods
crictl pods
List pods in ready state
crictl pods --state ready
List pods matching a name
crictl pods --name nginx
List pods in a specific namespace
crictl pods --namespace kube-system
Create and start a pod from config
crictl runp pod-config.json
Stop a running pod by ID
crictl stopp abc123
Remove a stopped pod by ID
crictl rmp abc123

Container Management

List all running containers
crictl ps
List all containers including stopped
crictl ps -a
Create a container in a pod
crictl create abc123 container.json pod.json
Start a created container
crictl start def456
Stop a running container
crictl stop def456
Remove a stopped container
crictl rm def456
Execute a command in a container
crictl exec -it def456 /bin/sh
Inspect a container with full details
crictl inspect def456

Image Management

List all images on the node
crictl images
Pull an image to the node
crictl pull nginx:alpine
Remove an image from the node
crictl rmi nginx:alpine
Inspect an image with details
crictl inspecti nginx:alpine
Show image filesystem information
crictl imagefsinfo

Logs

View logs from a container
crictl logs def456
View last 100 lines of logs
crictl logs --tail 100 def456
Follow log output in real time
crictl logs -f def456
View logs from the last hour
crictl logs --since 1h def456

Runtime Info

Display runtime and system information
crictl info
Show live resource usage of containers
crictl stats
Show stats for a specific container
crictl stats --id def456
Show crictl and runtime versions
crictl version

Quick Commands

List all containers including stopped ones on the node
crictl ps -a
Follow container log output in real time for debugging
crictl logs -f def456
Display CRI runtime information and system configuration
crictl info