Welcome to the Linux Foundation Forum!

[containerd] list of containers

Hello,
Calling sudo crictl ps -a produces two warnings and two errors:

$ k get po --all-namespaces 
NAMESPACE     NAME                                       READY   STATUS    RESTARTS       AGE
accounting    nginx-one-6f98c96fc6-7rfl5                 2/2     Running   6 (28m ago)    3d3h
accounting    nginx-one-6f98c96fc6-fmclb                 2/2     Running   6 (28m ago)    3d3h
accounting    nginx-one-6f98c96fc6-k62n5                 2/2     Running   6 (28m ago)    3d3h
accounting    nginx-one-6f98c96fc6-rz9t4                 2/2     Running   6 (28m ago)    3d3h
accounting    nginx-one-6f98c96fc6-x8mwh                 2/2     Running   6 (28m ago)    3d3h
default       my-nginx-dep-7577875bb4-kpvpb              1/1     Running   3 (28m ago)    3d6h
default       myingress-ingress-nginx-controller-627kz   2/2     Running   2 (28m ago)    24h
default       myingress-ingress-nginx-controller-g4p26   2/2     Running   4 (28m ago)    2d
default       web-one-6745f6ddd8-2zqbt                   1/1     Running   3 (28m ago)    3d3h
default       web-two-d8fdb7879-9xm8z                    1/1     Running   3 (28m ago)    3d3h
kube-system   calico-kube-controllers-56cdb7c587-w68kv   1/1     Running   8 (28m ago)    4d3h
kube-system   calico-node-2slwc                          1/1     Running   4 (28m ago)    4d3h
kube-system   calico-node-q9pkl                          1/1     Running   4 (28m ago)    4d3h
kube-system   coredns-6d4b75cb6d-67cnn                   1/1     Running   4 (28m ago)    4d3h
kube-system   coredns-6d4b75cb6d-chzsn                   1/1     Running   4 (28m ago)    4d3h
kube-system   etcd-cpnode                                1/1     Running   9 (28m ago)    4d3h
kube-system   kube-apiserver-cpnode                      1/1     Running   9 (28m ago)    4d3h
kube-system   kube-controller-manager-cpnode             1/1     Running   4 (28m ago)    4d3h
kube-system   kube-proxy-mm4sb                           1/1     Running   4 (28m ago)    4d3h
kube-system   kube-proxy-p9rx5                           1/1     Running   4 (28m ago)    4d3h
kube-system   kube-scheduler-cpnode                      1/1     Running   4 (28m ago)    4d3h
linkerd-viz   grafana-5595bcc798-6xwlv                   2/2     Running   6 (28m ago)    3d6h
linkerd-viz   metrics-api-69d57b76db-zfc6q               2/2     Running   12 (23m ago)   3d6h
linkerd-viz   prometheus-5db449486f-q6dn6                2/2     Running   6 (28m ago)    3d6h
linkerd-viz   tap-6b699d897f-52nzm                       2/2     Running   11 (28m ago)   3d6h
linkerd-viz   tap-injector-7489469df9-zxkd6              2/2     Running   8 (28m ago)    3d6h
linkerd-viz   web-55b57f8b89-htvgj                       2/2     Running   6 (28m ago)    3d5h
linkerd       linkerd-destination-d4bcbc947-7vvm2        4/4     Running   12 (28m ago)   3d6h
linkerd       linkerd-identity-685dc4fd66-9pzj6          2/2     Running   6 (28m ago)    3d6h
linkerd       linkerd-proxy-injector-85dfcb6798-zqptp    2/2     Running   8 (22m ago)    3d6h

$ sudo crictl ps -a
WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead. 
ERRO[0000] unable to determine runtime API version: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory" 
WARN[0000] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead. 
ERRO[0000] unable to determine image API version: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory" 
CONTAINER           IMAGE               CREATED             STATE               NAME                      ATTEMPT             POD ID              POD
03f5f040e7f23       04fcc70194086       33 minutes ago      Running             controller                1                   17749e5a9f78e       myingress-ingress-nginx-controller-627kz
e380aa9be5450       fb049291a9df1       35 minutes ago      Running             linkerd-proxy             1                   17749e5a9f78e       myingress-ingress-nginx-controller-627kz
08c5a3bfa7d6e       f13f2bbffc542       35 minutes ago      Exited              linkerd-init              1                   17749e5a9f78e       myingress-ingress-nginx-controller-627kz
9cb8bbfa08c2a       fbfd04bbb7f47       35 minutes ago      Running             calico-node               4                   32f39ef8efe5a       calico-node-2slwc
bc5cee820f48a       90d97aa939bbf       35 minutes ago      Exited              install-cni               0                   32f39ef8efe5a       calico-node-2slwc
23998919fdc52       90d97aa939bbf       36 minutes ago      Exited              upgrade-ipam              0                   32f39ef8efe5a       calico-node-2slwc
eba22165d57f6       beb86f5d8e6cd       36 minutes ago      Running             kube-proxy                4                   adb1513446c7a       kube-proxy-p9rx5
0bc226b330aff       aebe758cef4cd       37 minutes ago      Running             etcd                      9                   4fc9149069298       etcd-cpnode
000593b5bfae3       b4ea7e648530d       37 minutes ago      Running             kube-controller-manager   4                   013d7c5f7eb42       kube-controller-manager-cpnode
6bd3fb0c1ca5c       18688a72645c5       37 minutes ago      Running             kube-scheduler            4                   455890d4f878d       kube-scheduler-cpnode
56343cec3c54a       e9f4b425f9192       37 minutes ago      Running             kube-apiserver            9                   839b5ce1917e8       kube-apiserver-cpnode
0579e99004d96       04fcc70194086       24 hours ago        Exited              controller                0                   923f5bf12a33c       myingress-ingress-nginx-controller-627kz
43eb8c0346fa1       fb049291a9df1       24 hours ago        Exited              linkerd-proxy             0                   923f5bf12a33c       myingress-ingress-nginx-controller-627kz
7e69a70e2ef3a       fbfd04bbb7f47       25 hours ago        Exited              calico-node               3                   313920ced5df6       calico-node-2slwc
246ea0f0ee0da       beb86f5d8e6cd       25 hours ago        Exited              kube-proxy                3                   2de141993821f       kube-proxy-p9rx5
507a8ca5578ba       b4ea7e648530d       25 hours ago        Exited              kube-controller-manager   3                   ce6f69d9eacda       kube-controller-manager-cpnode
b45e20d890596       18688a72645c5       25 hours ago        Exited              kube-scheduler            3                   685494fb92b9b       kube-scheduler-cpnode
287a7a614b36b       e9f4b425f9192       25 hours ago        Exited              kube-apiserver            8                   88d831949abda       kube-apiserver-cpnode
9d302b0191c95       aebe758cef4cd       25 hours ago        Exited              etcd                      8                   926399ccacf48       etcd-cpnode

Any idea what goes wrong?

Best Answer

  • oleksazhel
    oleksazhel Posts: 57
    Answer ✓

    @thomas.bucaioni You can find out what container runtime is used on you kates nodes with this command kubectl get nodes -o wide and use the same for crictl.
    For example if you want to use containerd runtime you have to use this command:

    echo "===================================" &&\
    echo "Config BEFORE change:" &&\
    sudo cat /etc/crictl.yaml &&\
    sudo crictl config --set runtime-endpoint=unix:///run/containerd/containerd.sock --set image-endpoint=unix:///run/containerd/containerd.sock &&\
    echo "===================================" &&\
    echo "Config AFTER change:" &&\
    sudo cat /etc/crictl.yaml
    

Answers

Categories

Upcoming Training