- Install Azure CLI on Liux (don't use apt install azure-cli directly on WSL, use below script)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- Install kubectl using azure cli on Linux (Recommended for AKS)
sudo az aks install-cli
- kubectl and kubelogin will be downloaded to /usr/local/bin ($PATH)
- Use below command to modify .kube/config file by adding the login method (Below command uses Azure CLI)
export KUBECONFIG=~/.kube/config
kubelogin convert-kubeconfig -l azurecli
- open .bashrc file
vim ~/.bashrc
- Add following code to .bashrc
source <(kubectl completion bash)
complete -F __start_kubectl k
alias k=kubectl
alias kn='k config set-context --current --namespace'
- Reload bash profile
source ~/.bashrc
- Using kubectl debug (https://learn.microsoft.com/en-us/azure/aks/node-access)
- Using node-shell (Uses an alpine pod with nsenter for Linux nodes) (https://github.com/kvaps/kubectl-node-shell)
- To see the node internal route table (Connect to the node)
- This displays the routing table which includes entries added by kubenet for routing traffic between pods in the same node
ip route show
- To see the ARP table
- Output indicates the pod ips, associated mac and interface
arp -a