Skip to content

Instantly share code, notes, and snippets.

@cdornsife
Created December 24, 2024 15:46
Show Gist options
  • Save cdornsife/ee9029e2d5cf2206de11da66c17a33c9 to your computer and use it in GitHub Desktop.
Save cdornsife/ee9029e2d5cf2206de11da66c17a33c9 to your computer and use it in GitHub Desktop.
Add EKS cluster kubeconfig for each cluster and region.
#!/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