skip to Main Content

how to check running docker containers and images for the deployed pods inside aks nodes?

I have deployed company pods and services inside the azure aks cluster.

Need to login as a root user inside containers running inside nodes of managed aks cluster. Those containers are of rabbitmq pods deployed with bitnami helm chart.

I was able to login into worker nodes by following this link https://learn.microsoft.com/en-us/azure/aks/node-access, but couldn’t find the docker package running/installed inside them.

They do have containerd://1.4.9+azure as the CONTAINER-RUNTIME.
Tried below commands of ‘containerd’ inside those nodes, but nothing came, empty response, no running containers or downloaded images.

ctr  container ls
ctr images ls

So how to check running docker containers and images for the deployed pods inside aks nodes?

2

Answers


  1. Chosen as BEST ANSWER

    We can use the below commands to check running containers inside worker nodes of managed k8s clusters at least in the case of aks clusters.

    Here's the reference link https://kubernetes.io/docs/tasks/debug-application-cluster/crictl/

    use below commands

    sudo crictl --help
    sudo crictl ps
    sudo crictl images
    
    

  2. I use nerdctl instead. Here are the steps work for me..

    1. Create a debug pod to access the aks node
    kubectl debug node/<nodeName> -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0
    
    1. You can interact with the node session by running below command:
    chroot /host
    
    1. Install nerdctl tool:
    wget https://github.com/containerd/nerdctl/releases/download/v0.20.0/nerdctl-0.20.0-linux-amd64.tar.gz
    tar zxvf nerdctl-0.20.0-linux-amd64.tar.gz -C /usr/local/bin/
    alias n=nerdctl
    
    1. Check the containers in the AKS node
    nerdctl --namespace k8s.io ps -a
    

    Reference:

    https://kubernetes.io/docs/tasks/debug/debug-cluster/crictl/

    https://learn.microsoft.com/en-us/azure/aks/node-access

    https://github.com/containerd/nerdctl#whale-nerdctl-load

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search