Skip to main content
๐ŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy โ€” plus the companion book on Leanpub & Amazon. Start Learning
crictl Cheat Sheet 2026: Kubernetes CRI Commands
DevOps

crictl Cheat Sheet 2026: Kubernetes CRI Commands

crictl cheat sheet for debugging Kubernetes container runtime issues. Inspect pods, containers, images, and logs directly through the CRI interface.

LB
Luca Berton
ยท 1 min read

A quick reference for crictl โ€” the Kubernetes CRI debugging tool. Bookmark this page.

Container Operations

# List containers
crictl ps                    # Running
crictl ps -a                 # All (including stopped)
crictl ps -o json            # JSON output

# Inspect container
crictl inspect CONTAINER_ID

# View logs
crictl logs CONTAINER_ID
crictl logs -f CONTAINER_ID          # Follow
crictl logs --tail 50 CONTAINER_ID   # Last 50 lines

# Execute command in container
crictl exec -it CONTAINER_ID sh

# Stop and remove
crictl stop CONTAINER_ID
crictl rm CONTAINER_ID

Pod Operations

# List pods
crictl pods
crictl pods --name nginx             # Filter by name
crictl pods --state Ready            # Filter by state

# Inspect pod
crictl inspectp POD_ID

# Stop and remove pod
crictl stopp POD_ID
crictl rmp POD_ID

Image Operations

# List images
crictl images
crictl images -o json

# Pull image
crictl pull nginx:alpine

# Inspect image
crictl inspecti nginx:alpine

# Remove image
crictl rmi nginx:alpine

# Remove unused images
crictl rmi --prune

Runtime Info

# Show runtime info
crictl info

# Show runtime version
crictl version

# Show container stats
crictl stats
crictl stats CONTAINER_ID

Configuration

# /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false

Troubleshooting Kubernetes

# Find container for a pod
crictl ps --name my-pod

# Check why a pod is failing
crictl pods --state NotReady
crictl logs $(crictl ps -a --name failing-container -q)

# Check image pull issues
crictl pull image:tag 2>&1

# Clean up stopped containers
crictl rm $(crictl ps -a -q --state Exited)

Tips and Tricks

  • Set runtime-endpoint in /etc/crictl.yaml to avoid passing -r every time
  • Use crictl for Kubernetes debugging, ctr for containerd-level operations
  • Use -o yaml or -o json for scripting
  • crictl stats shows real-time CPU/memory per container

Free 30-min AI & Cloud consultation

Book Now