먼저 kubeconfig를 합니다.
aws eks --region ap-northeast-2 update-kubeconfig --name wsi-eks-cluster
iam-authenticator설치합니다.
curl -o aws-iam-authenticator https://s3.us-west-2.amazonaws.com/amazon-eks/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator
chmod +x ./aws-iam-authenticator
mkdir -p $HOME/bin && cp ./aws-iam-authenticator $HOME/bin/aws-iam-authenticator && export PATH=$PATH:$HOME/bin
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
aws-iam-authenticator help
설정(Root 계정)
export AWS_ACCESS_KEY_ID=AKIAZ42E7S3RFS42WUME
export AWS_SECRET_ACCESS_KEY=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
aws sts get-caller-identity #Root 계정 설정 확인
토큰 가져오기
aws-iam-authenticator token -i wsi-eks-cluster
토큰 사용해서 EKS Cluster 인증 하기
aws-iam-authenticator token -i k8s-aws-v1.aHR0cHM6Ly9zdHMuYXAtbm9ydGhlYXN0LTIuYW1hem9uYXdzLmNvbS8_QWN0aW9uPUdldENhbGxlcklkZW50aXR5JlZlcnNpb249MjAxMS0wNi0xNSZYLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFTSUFaNDJFN1MzUklKRkRUWUZJJTJGMjAyMjA4MTUlMkZhcC1ub3J0aGVhc3QtMiUyRnN0cyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjIwODE1VDExMDIwNlomWC1BbXotRXhwaXJlcz0wJlgtQW16LVNlY3VyaXR5LVRva2VuPUlRb0piM0pwWjJsdVgyVmpFRklhRG1Gd0xXNXZjblJvWldGemRDMHlJa1l3UkFJZ05ZZFhuQXBJT1RWcyUyRm0lMkY3M052d3E5MXN1NVhDT0JOckhoT3AwNHp4a3NJQ0lCMHI0NzZJRFNpJTJCa3dkeEVCOHBmaUMzSzFtNjR1SFZTazdVcHhXUFN1WE5LdXNFQ0x2JTJGJTJGJT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