4

I have a node which has both docker and cri-containerd installed. When I do docker ps nothing gets listed where as crictl ps lists some containers. Could any one explain in detail how these commands differ. I have ctr installed as well. ctr containers list also doesn't list any containers.

ambikanair
  • 4,004
  • 11
  • 43
  • 83
  • Just an FYI , I cannot find nor am I able to create new tags for cri-containerd,crictl, ctr etc. – ambikanair Feb 05 '18 at 05:18
  • in the title you ask can the systems co-exist, but in the question body you ask for explanations on how these commands differ. Which is it? – eis Feb 05 '18 at 05:57
  • @eis When there is difference in output of the commands which I have mentioned in the query [ considering the fact that all of those commands are intended to give same output as per my understanding.only the syntax is different], I have 1 ) doubt whether the system can co-exist , 2) if someone can answer the question above and little more details on the same would be helpful as the documentation for these clis are not sufficient. – ambikanair Feb 05 '18 at 06:42

1 Answers1

4

If you read the crictl doc carefully, the cri plugin uses the "k8s.io" containerd namespace.

You can list all containerd namespaces with sudo ctr ns ls:

$ sudo ctr ns ls
NAME   LABELS 
k8s.io        
moby          

If you want to see containers created by crictl from ctr, be sure to add the -n k8s.io option

$ sudo ctr -n k8s.io containers ls
CONTAINER     IMAGE                              RUNTIME                  
ubuntu-crictl    docker.io/library/ubuntu:latest    io.containerd.runc.v2    

Also, here is a talk about various container runtimes on YouTube where the same problem is explained by the speaker.

btwiuse
  • 2,585
  • 1
  • 23
  • 31