Monday, January 3, 2022

kubectl: How to switch between multiple clusters and to see current cluster configuration

To add a cluster to kubectl configuration(for azure kubernetes):

az aks get-credentials --resource-group aks-rg3 --name aksdemo3
az aks get-credentials --resource-group aks-rg4 --name aksdemo4

To view current cluster configuration:
kubectl config view
kubectl config current-context

To switch context:
kubectl config use-context aksdemo3


No comments:

Post a Comment