Skip to content

Instantly share code, notes, and snippets.

@mainda01
Created April 4, 2023 13:44
Show Gist options
  • Select an option

  • Save mainda01/6f3af1720141b22d504d7fb18921a8c8 to your computer and use it in GitHub Desktop.

Select an option

Save mainda01/6f3af1720141b22d504d7fb18921a8c8 to your computer and use it in GitHub Desktop.
Prepare kubeconfig for MBS AKS Clusters
# credentials are merged with .kube/config
az login
for account in dev nonprod prod; do
echo "Changing to us-mbs-${account}"
az account set --name "us-mbs-${account}"
for application in linux win; do
for cluster in eastus eastus-backup; do
if [[ "${cluster}" =~ "backup" ]]; then
i="2"
else
i="1"
fi
az aks get-credentials --resource-group app-mbs${application}-${account}-${cluster} --name app-${application}mbs-${account}-eastus-aks-${i} 2>/dev/null
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment