-
Install Azure CLI on macOS(will install kubectl as well)
brew update && brew install azure-cli
-
Install kubelogin
brew install Azure/kubelogin/kubelogin
To upgrade:
brew update && brew upgrade Azure/kubelogin/kubelogin
-
Login to azure
az login
-
Set cluster subscription
az account set --subscription <>
-
Download cluster credentials
az aks get-credentials --resource-group <> --name <> --overwrite-existing
-
Use kubelogin plugin for authentication
kubelogin convert-kubeconfig -l azurecli
-
Find the current context
kubectl config current-context
-
List contexts
kubectl config get-contexts
-
Change/set context
kubectl config use-context <context-name>
Modify current context
kubectl config set-context --current --namespace=<namespace-name>
-
List pods
kubectl get pods -n <namespace> -l k8s-app=<label>
kubectl get pods --all-namespaces
-
Finding master
kubectl cluster-info