Featured image of post How to Login Aks in Debian 12

How to Login Aks in Debian 12

Install az-cli

1
2
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
zsh

Install kubectl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#Install Kubectl
if [ ! -f /usr/local/bin/kubectl ]
then
	sudo curl -fsSL --progress-bar "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl
sudo chmod +x /usr/local/bin/kubectl
fi

#Reload zsh
zsh 


#add alias into ~/.zshrd
if ! sudo grep -q "kubectl" ~/.zshrc; then
  cat << EOF |sudo tee -a  ~/.zshrc
alias k=kubectl

EOF
fi
zsh
cat ~/.zshrc | grep kubectl

Get Contributer Privilege with PIM

Get the Contributer PIM firstly on azure portal

Login aks

1
2
3
4
5
az login --use-device-code
az account set --subscription YOUR_SUBSCRIPTION
az aks get-credentials --resource-group RESOURCE-GROUP --name AKS-NAME --admin
kubectl config current-context
kubectl get po -A

Reference

Built with Hugo
Theme Stack designed by Jimmy