Life's random bits By b1thunt3r (aka Ishan Jain)…
Get Shell Session into Kubernetes Worker Node

Get Shell Session into Kubernetes Worker Node

Ishan jain
Open a shell on Azure Kubernetes Node, without SSH.

In my last post, I talked about connecting to a Azure Kubernetes (AKS) worker node using SSH. But sometimes, you might not have access to the private key used and don't want to update the key either.
Kubernetes provides a way to access worker node.

  1. List Nodes

    kubectl get nodes -o wide
    
  2. Connect to worker node

    kubectl debug node/<node> -it --image=mcr.microsoft.com/cbl-mariner/busybox:2.0
    

    Where:

    • node: name of the node

    For example, the following command will connect to aks-nodepool1-37663765-vmss000000

    kubectl debug node/aks-nodepool1-37663765-vmss000000 -it --image=mcr.microsoft.com/cbl-mariner/busybox:2.0
    

Resources