Created
April 4, 2023 13:44
-
-
Save mainda01/6f3af1720141b22d504d7fb18921a8c8 to your computer and use it in GitHub Desktop.
Prepare kubeconfig for MBS AKS Clusters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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