6

I've switched to containerd in a k8s cluster.

There's 2 pods running on one node, 2 github runners.

I used to check on a host what containers were running with "docker container ls" but how to check this when containerd is used?

sudo ctr container ls

comes back with nothing

3
  • 1
    Try with crictl ps & crictl pods. To be honest, I'm a bit confused between cri-o and containerd as well. Looking at kubespray especially, I would have both options, while setting "containerd" as a runtime, I would still end up using crictl listing/viewing pods, while as you suggest: ctr doesn't show anything.
    – SYN
    Oct 26, 2022 at 16:11
  • ah yes, crictl does the job. Is that a general name so that it works with any cri? Oct 27, 2022 at 5:17
  • Check your /etc/crictl.yaml: when using containerd, your crictl configuration would just query containerd's socket file
    – SYN
    Oct 27, 2022 at 6:23

1 Answer 1

13

Try to namespace to list command

ctr -n k8s.io containers list

To list available namespaces run

ctr ns ls

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.