일반적으로 EKS cluster 를 생성한 계정 이외에 다른 IAM 사용자나 role 을 세분화하여 추가할 수 있으며, 심플한 사용자 추가를 진행해 보았다. 예전에 뭣 때문에 eksctl 을 설치했는지는 모르겠다만 땡큐~
eksctl 이 설치되어 있지 않다면... https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/eksctl.html
eksctl 설치 또는 업데이트 - Amazon EKS
GitTag 버전은 0.105.0 이상이어야 합니다. 그렇지 않은 경우 터미널 출력에서 설치 또는 업그레이드 오류가 있는지 확인하거나, 1단계의 주소를 https://github.com/weaveworks/eksctl/releases/download/v0.105.0/eksct
docs.aws.amazon.com
eksctl 을 이용하면 간단히 cluster 정보와 추가할 iam 계정의 arn, ClusterRoleBinding group 을 지정한다.
$ eksctl create iamidentitymapping \
--cluster cluster-name \
--region=ap-northeast-2 \
--arn arn:aws:iam::111122223333:user/ggamzzak \
--group system:masters \
--profile my-profile
2022-08-02 17:25:32 [ℹ] eksctl version 0.75.0
2022-08-02 17:25:32 [ℹ] using region ap-northeast-2
2022-08-02 17:25:32 [ℹ] adding identity "arn:aws:iam::111122223333:user/ggamzzak" to auth ConfigMap
"system:masters" 그룹의 자격 증명을 사용하면 cluster-admin 슈퍼유저의 역할을 바인딩하여 모든 작업을 수행할 수 있다.
configmap/aws-auth 를 확인하면 다음과 같이 추가되어 있다.
$ kubectl describe configmap -n kube-system aws-auth
Name: aws-auth
Namespace: kube-system
Labels: <none>
Annotations: <none>
Data
====
mapUsers:
----
- groups:
- system:masters
userarn: arn:aws:iam::111122223333:user/ggamzzak
mapRoles:
...
또는,
$ eksctl get iamidentitymapping --cluster my-cluster --region=ap-northeast-2 --profile my-profile
2022-08-02 20:52:23 [ℹ] eksctl version 0.75.0
2022-08-02 20:52:23 [ℹ] using region ap-northeast-2
ARN USERNAME GROUPS ACCOUNT
...
arn:aws:iam::111122223333:user/ggamzzak system:masters
추가된 IAM 계정으로 테스트 ㄱㄱ~
WRITTEN BY
- 손가락귀신
정신 못차리면, 벌 받는다.
,