As per previous posts, I've been tinkering ( gosh, I love that word ) with containerd and Kata 2.0 a lot recently.
Having deployed containerd and Kata 2.0 into my Kubernetes 1.21 environment, I am happily creating Pods using the Kata runtime: -
vi nginx-kata.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-kata
spec:
runtimeClassName: kata
containers:
- name: nginx
image: nginx
kubectl apply -f nginx-kata.yaml
and then using tools such as
crictl to see what's going on ( on the K8s Compute Node ) : -
vi /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false
crictl pods
POD ID CREATED STATE NAME NAMESPACE ATTEMPT
dc02fc7c89641 10 minutes ago Ready nginx-kata default 0
d1f8ce098f089 2 days ago Ready coredns-558bd4d5db-qwfl9 kube-system 0
7f3783a919973 2 days ago Ready coredns-558bd4d5db-54k58 kube-system 0
5dca2e336f243 2 days ago Ready calico-kube-controllers-cc8959d7f-xwggk kube-system 0
9a9bca9a8e611 2 days ago Ready calico-node-wvn6q kube-system 0
d98889f80a38a 2 days ago Ready kube-proxy-bc897 kube-system 0
crictl ps
CONTAINER ID IMAGE CREATED STATE NAME ATTEMPT POD ID
efefdc0c91767 4f380adfc10f4 11 minutes ago Running nginx 0 dc02fc7c89641
7bc01b279a245 296a6d5035e2d 2 days ago Running coredns 0 d1f8ce098f089
693fae66b8cff 296a6d5035e2d 2 days ago Running coredns 0 7f3783a919973
ebd27f6028920 2ce0e04399aca 2 days ago Running calico-kube-controllers 0 5dca2e336f243
dac664782bbac ebc659140e762 2 days ago Running calico-node 0 9a9bca9a8e611
fc7b02adf0cfe 38ddd85fe90e0 2 days ago Running kube-proxy 0 d98889f80a38a
but I wanted to also see what was going on using the ctr tool, which ships with containerd
I tried this: -
ctr container list
but that only returned: -
CONTAINER IMAGE RUNTIME
I even tried directing ctr to the same endpoint as crictl : -
ctr --address /run/containerd/containerd.sock containers list
which similarly returned: -
CONTAINER IMAGE RUNTIME
I dug about online for a bit and and found this: -
in the containerd GitHub repo, which said, in part: -
containerd has namespaces: https://github.com/containerd/containerd/blob/master/README.md#namespaces
ctr --namespace k8s.io containers ls
Once I amended my command: -
ctr --namespace k8s.io container list
all was well: -
CONTAINER IMAGE RUNTIME
5dca2e336f24335693c6e6e36bfa9448b77f62ebd24dc6ff7dfbad6046b4e451 k8s.gcr.io/pause:3.2 io.containerd.runc.v2
693fae66b8cffa4a6f2502704e6fb3ae581a85154284158122801e272182a480 k8s.gcr.io/coredns/coredns:v1.8.0 io.containerd.runc.v2
7bc01b279a245902df8a74daa2647158992ca304313772002d3b92f989c832b4 k8s.gcr.io/coredns/coredns:v1.8.0 io.containerd.runc.v2
7e9debe26471498d06a99403ade2b46e9ce8ef50cade17a2a44efddcacb7ec70 sha256:021ecb3cb5348375a201bc8e2fe97c04da8c675a89185ae5bb597f7b2bdd2097 io.containerd.runc.v2
7f3783a9199736931fa2b97915238e024f17ecb456c2c83e89520e4c0e4de6f3 k8s.gcr.io/pause:3.2 io.containerd.runc.v2
9a9bca9a8e61143df776733aca2503094fa6ab7560f06c9a6809942f16418cd0 k8s.gcr.io/pause:3.2 io.containerd.runc.v2
a0f5f0b540e2bcde26ab4cb7ea887718202252ec9abe35b8be3bc351c9163d2c sha256:021ecb3cb5348375a201bc8e2fe97c04da8c675a89185ae5bb597f7b2bdd2097 io.containerd.runc.v2
d1f8ce098f089ffc85065d003c803223bd89f9508b5f78fccfcb7942b1a17f4d k8s.gcr.io/pause:3.2 io.containerd.runc.v2
d89404d155c09d8b2d5134989675593b2d45a3fe2b7972c1aba83f990af92dca docker.io/calico/pod2daemon-flexvol:v3.18.4 io.containerd.runc.v2
d98889f80a38aa7b5dde86f7560b3a5791f2e621896063f991a994e79b84cce1 k8s.gcr.io/pause:3.2 io.containerd.runc.v2
dac664782bbacf4e9d531c79d8702ce7070b7cbf6ef0e0f6936036c574c1d946 docker.io/calico/node:v3.18.4 io.containerd.runc.v2
dc02fc7c8964173ac4d9273590191079b9aa943de62071cebdf31784dbe28b89 sha256:80d28bedfe5dec59da9ebf8e6260224ac9008ab5c11dbbe16ee3ba3e4439ac2c io.containerd.kata.v2
ebd27f60289200020add88b0e09de8347521ddd9a9710f1dd5ea1b824be38ea4 sha256:2ce0e04399acab807c909223153f44dcd197765af5eb1e0a858acaf8869b27e4 io.containerd.runc.v2
efefdc0c917678590423c193f59ab3bcce02c7282fe876422506fd45e9693967 docker.io/library/nginx@sha256:8f7dcfc0d8c01c5b66a49f1f33803c959a354fabb4d0128e6144a7732c8e70eb io.containerd.kata.v2
fc7b02adf0cfe264f02a8dffe6ba938377b129eb51a471257d58f524cf05351f k8s.gcr.io/kube-proxy:v1.21.0 io.containerd.runc.v2
No comments:
Post a Comment