$ k apply -f test.yaml
pod/busybox created
controlplane ~ ✖ k get pods
NAME READY STATUS RESTARTS AGE
busybox 1/1 Running 0 20m
controlplane ~ ➜ kubectl describe pod busybox | grep -i "container id"
Container ID: containerd://37860175d71a5ba9aeb825a3161c81171f638b22ee49e824bec0cdc2c303347d
controlplane ~ ➜ crictl ps -a | grep "37860175d71a5ba9aeb825a3161c81171f638b22ee49e824bec0cdc2c303347d"
controlplane ~ ✖ crictl inspect 37860175d71a5ba9aeb825a3161c81171f638b22ee49e824bec0cdc2c303347d
E0415 08:15:56.531686 18176 log.go:32] "ContainerStatus from runtime service failed" err="rpc error: code = NotFound desc = an error occurred when try to find container \"37860175d71a5ba9aeb825a3161c81171f638b22ee49e824bec0cdc2c303347d\": not found" containerID="37860175d71a5ba9aeb825a3161c81171f638b22ee49e824bec0cdc2c303347d"
FATA[0000] get the status of containers: get container status: rpc error: code = NotFound desc = an error occurred when try to find container "37860175d71a5ba9aeb825a3161c81171f638b22ee49e824bec0cdc2c303347d": not found
Kindly let me know why the container ID is not reported in the crictl ps command ?
it’s likely pointing to the wrong socket. Set the correct socket with crictl config --set runtime-endpoint=unix:///run/containerd/containerd.sock and make sure containerd is running with systemctl status containerd.
If you’re doing this as part of a lab, please share the lab link so I can get more context and help you better.
The reason crictl ps -a is not showing the container ID from kubectl describe pod is likely due to a runtime mismatch.
Kubernetes is reporting the container using the containerd:// prefix, which means it’s using containerd as the container runtime. However, crictl must be properly configured to communicate with containerd via the correct socket.
To fix this, check or set the runtime endpoint for crictl: