crictl

crictl provides a CLI for CRI-compatible container runtimes. It is similiar to other container CLIs like Docker. It can be used to control the container runtime of k3s.

Usage

crictl [global options] command [command options] [arguments...]

COMMANDS:

  • attach: Attach to a running container
  • create: Create a new container
  • exec: Run a command in a running container
  • version: Display runtime version information
  • images, image, img: List images
  • inspect: Display the status of one or more containers
  • inspecti: Return the status of one or more images
  • imagefsinfo: Return image filesystem info
  • inspectp: Display the status of one or more pods
  • logs: Fetch the logs of a container
  • metricsp: List pod metrics. Metrics are unstructured key/value pairs gathered by CRI meant to replace cAdvisor’s /metrics/cadvisor endpoint.
  • metricdescs: List metric descriptors. Returns information about the metrics available through the CRI.
  • port-forward: Forward local port to a pod
  • ps: List containers
  • pull: Pull an image from a registry
  • run: Run a new container inside a sandbox
  • runp: Run a new pod
  • rm: Remove one or more containers
  • rmi: Remove one or more images
  • rmp: Remove one or more pods
  • pods: List pods
  • start: Start one or more created containers
  • info: Display information of the container runtime
  • stop: Stop one or more running containers
  • stopp: Stop one or more running pods
  • update: Update one or more running containers
  • config: Get and set crictl client configuration options
  • stats: List container(s) resource usage statistics
  • statsp: List pod(s) resource usage statistics
  • completion: Output bash shell completion code
  • checkpoint: Checkpoint one or more running containers
  • events, event: Stream the events of containers
  • update-runtime-config Update the runtime configuration
  • help, h: Shows a list of commands or help for one command

crictl by default connects on Unix to:

  • unix:///run/containerd/containerd.sock or
  • unix:///run/crio/crio.sock or
  • unix:///var/run/cri-dockerd.sock