iximiuz / cdebug

cdebug - a swiss army knife of container debugging
https://iximiuz.com/en/posts/docker-debug-slim-containers/
Apache License 2.0
1.23k stars 47 forks source link

Support of containerd namespaces (k8s particularly) #6

Closed kappa8219 closed 1 year ago

kappa8219 commented 1 year ago

It is not really an issue, more like a FR :)

Trying cdebug I discovered that containerd is namespaced. And default NS is (surprise) "default". I see no posibillity to change it with parameters.

Thus we have k8s workload containers out of reach:

# ctr -n k8s.io containers list | head -n 2
CONTAINER                                                           IMAGE                                                                              RUNTIME                  
03b775021b8b6010bdd47c989264ed6e1dc055247bcb4422ecec330fc56f98a1    public.ecr.aws/isovalent/cilium:v1.11.8-eksa.1                                     io.containerd.runc.v2    

# ctr -n default containers list
CONTAINER          IMAGE                               RUNTIME                  
cdebug-a442c538    docker.io/library/busybox:latest    io.containerd.runc.v2    
nginx-1            docker.io/library/nginx:latest      io.containerd.runc.v2    

Can you please either add containerd namespace as parameter? I'v seen k8s support upcoming feature. Will it be k8s:// prefix as a namespace setter or pods support (like crictl capable). Any of these are nice and expected features.

kappa8219 commented 1 year ago

https://github.com/iximiuz/cdebug/commit/4a4c24157c0f2dbd9c3f720e6833e2dedeca5673#r92063972

iximiuz commented 1 year ago

Great catch! Fixed in v0.0.5. Here is an example of how to debug a containerd-cri container.