Created
July 22, 2019 03:39
-
-
Save robertstarmer/bfa649933bb9f8ce1b489c1d6e903975 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
if [ $# != 1 ] ; then | |
echo 'what is the cluster name' | |
echo $0 " {cluster_name}" | |
exit 1 | |
fi | |
echo "private ENI IPs for EKS $1" | |
IP=`aws ec2 describe-network-interfaces --filter "Name=description,Values=*${1}*" --query "NetworkInterfaces[0].PrivateIpAddress" | tr -d '"'` | |
aws eks update-kubeconfig --name ${1} --kubeconfig /tmp/${1}.kubeconfig | |
sed -i "s,https://.*$,https://${IP}," /tmp/${1}.kubeconfig | |
mv /tmp/${1}.kubeconfig ~/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment