11

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

Serve Laurijssen
  • 594
  • 2
  • 8
  • 17

2 Answers2

25

Try to namespace to list command

ctr -n k8s.io containers list

To list available namespaces run

ctr ns ls

For microk8s you have to prefix command with microk8s

eg: microk8s ctr ns ls

Serve Laurijssen
  • 594
  • 2
  • 8
  • 17
fsp
  • 366
  • 4
  • 3
2

I feel relevant and important to note that:

ctr c ls

lists all containers, i.e. either stopped or running.

In accordance with the question title: to precisely list all running containers (in the sense of docker terminology) you need to use this command:

ctr task list

or the shorthand

ctr t ls
adamency
  • 121
  • 1