logo

crictl vs ctr

TL;DR: ctr is containerd specific; crictl is kubeneretes related, for any container runtime.

  • ctr is the CLI of containerd, not related to k8s.
    • ctr -v for containerd version.
  • crictl is the CLI of CRI (Container Runtime Interface)
    • kubernetes uses crictl
    • for any CRI compliant runtime, e.g. docker, containerd, podman; kubernetes does not care which runtime it is.
    • crictl -v for kubernetes version.
    • config: /etc/crictl.yaml
  • ctr image is namespaced: crictl image list = ctr -n=k8s.io image list

Which one to use?

If you are using Kubernetes, regardless of the actual runtime, use crictl;

If you are using containerd directly, use ctr.

Some functions may be provided by both CLIs:

crictl image = ctr -n=k8s.io images ls