[AZURE AKS] access AKS cluster nodes

Seunghyun Moon·2022년 10월 11일
0

azure

목록 보기
2/2

there are times we want to k8s computing nodes on AKS.

follow below steps on azure powershell or azure cli


  • get nodes
PS /home/cho> kubectl get no -o wide
NAME                              STATUS   ROLES   AGE   VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION     CONTAINER-RUNTIME
aks-default-34557426-vmss000000   Ready    agent   67d   v1.21.9   10.240.0.4     <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000001   Ready    agent   49d   v1.21.9   10.240.0.35    <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000002   Ready    agent   49d   v1.21.9   10.240.0.66    <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000003   Ready    agent   49d   v1.21.9   10.240.0.97    <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000004   Ready    agent   49d   v1.21.9   10.240.0.128   <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000005   Ready    agent   49d   v1.21.9   10.240.0.159   <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000006   Ready    agent   49d   v1.21.9   10.240.0.190   <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000007   Ready    agent   49d   v1.21.9   10.240.0.221   <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000008   Ready    agent   49d   v1.21.9   10.240.0.252   <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3
aks-default-34557426-vmss000009   Ready    agent   49d   v1.21.9   10.240.1.27    <none>        Ubuntu 18.04.6 LTS   5.4.0-1073-azure   containerd://1.4.12+azure-3코드를 입력하세요
  • access containers using kubectl debug
PS /home/cho> kubectl debug node/aks-default-34557426-vmss000000 -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0  
Creating debugging pod node-debugger-aks-default-34557426-vmss000000-vrk92 with container debugger on node aks-default-34557426-vmss000000.
If you don't see a command prompt, try pressing enter.
root@aks-default-34557426-vmss000000:/# 
root@aks-default-34557426-vmss000000:/#            
root@aks-default-34557426-vmss000000:/# ls
bin  boot  dev  etc  home  host  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var코드를 입력하세요
  • we are inside a node!
root@aks-default-34557426-vmss000000:/# chroot /host /bin/bash
root@aks-default-34557426-vmss000000:/# ls
NOTICE.txt  bin  boot  dev  etc  home  initrd.img  initrd.img.old  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var  vmlinuz  vmlinuz.old
root@aks-default-34557426-vmss000000:/# ls /etc/kubernetes/
azure.json  certs  manifests  volumeplugins

reference
https://learn.microsoft.com/ko-kr/azure/aks/node-access

profile
I live fullest

0개의 댓글