Created
December 24, 2024 15:46
-
-
Save cdornsife/ee9029e2d5cf2206de11da66c17a33c9 to your computer and use it in GitHub Desktop.
Add EKS cluster kubeconfig for each cluster and region.
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
#!/usr/bin/env bash | |
for region in us-east-1 us-east-2; do | |
aws eks list-clusters --region $region --query 'clusters' --output text | tr '\t' '\n' \ | |
| while IFS= read -r line; do | |
aws eks --region $region update-kubeconfig \ | |
--name "${line}" \ | |
--alias "${line}" \ | |
--profile default | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment