삽질 해결 - EKS Pod Identity-Agent 관련(With EBS-CSI-Driver) 삽질
개요
테라폼으로 aws-ebs-csi-driver 애드온을 배포하고, IRSA 를 통하여 EBS-CSI-Driver의 정상 동작을 확인하였습니다.
이후, OIDC Provider 연결이 작업이 번거로워 Pod Identity 방식으로 전환을 시도하였는데 그때 발생한 이슈를 정리하였습니다.
EBS-CSI-Driver와 Pod Identity Agent는 이미 애드온 형태로 배포된 상태.

EKS Pod Identity에서 요구하는 신뢰 정책으로 IAM 역할 생성 완료된 상태.

네임스페이스와 서비스 어카운트에 맞게 IAM 역할 연결이 완료된 상태.

그러나, 아래와 같이 배포한 pvc 상태를 확인하면 pending 상태이고 아래와 같이 403 권한 에러가 발생.
[ec2-user@ip-??-???-?-??? ~]$ k get pv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS
ebs-claim Pending gp3 <unset>

$ k describe pvc
Name: ebs-claim
Namespace: default
StorageClass: gp3
Status: Pending
Volume:
Labels: <none>
Annotations: volume.beta.kubernetes.io/storage-provisioner: ebs.csi.aws.com
volume.kubernetes.io/selected-node: ip-??-???-??-???.us-west-2.compute.internal
volume.kubernetes.io/storage-provisioner: ebs.csi.aws.com
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Used By: app
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 11s persistentvolume-controller storageclass.storage.k8s.io "gp3" not found
Warning ProvisioningFailed 10s ebs.csi.aws.com_ebs-csi-controller-?????? failed to provision volume with StorageClass "gp3": rpc error: code = Internal desc = Could not create volume "pvc-?????": could not create volume in EC2: operation error EC2: CreateVolume, get identity: get credentials: failed to refresh cached credentials, failed to retrieve credentials, operation error STS: AssumeRoleWithWebIdentity, https response error StatusCode: 403, RequestID: a749af29-?????, api error AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity
Warning ProvisioningFailed 9s ebs.csi.aws.com_ebs-csi-controller-?????? failed to provision volume with StorageClass "gp3": rpc error: code = Internal desc = Could not create volume "pvc-?????": could not create volume in EC2: operation error EC2: CreateVolume, get identity: get credentials: failed to refresh cached credentials, failed to retrieve credentials, operation error STS: AssumeRoleWithWebIdentity, https response error StatusCode: 403, RequestID: a749af29-?????, api error AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity

해결
Pod Identity Agent 을 사용해 권한을 부여해 준 뒤, 해당 서비스의 컨트롤러(Controller)는 재시작이 필요함.
$ kubectl rollout restart -n kube-system deploy ebs-csi-controller
EBS CSI Drvier 재시작 후에는 아래와 같이 정상적으로 pvc 가 Bound 상태로 변경되는 것이 확인.
[ec2-user@ip-??-???-?-??? ~]$ k get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS
ebs-claim Bound pvc-???? 1Gi RWO gp3

참고
'에러 & 삽질' 카테고리의 다른 글
댓글
이 글 공유하기
다른 글
-
삽질 해결 - VPC Flow Log format 사용자 지정 형식(Custom) 삽질
삽질 해결 - VPC Flow Log format 사용자 지정 형식(Custom) 삽질
2025.03.19 -
에러 해결 - User not authorized to perform kms:CreateGrant operation
에러 해결 - User not authorized to perform kms:CreateGrant operation
2025.03.15 -
삽질 해결 - aws_iam_policy_attachment 삭제 시, 정책과 연결된 Group/Role/User의 정책 연결 해제 방지 방안
삽질 해결 - aws_iam_policy_attachment 삭제 시, 정책과 연결된 Group/Role/User의 정책 연결 해제 방지 방안
2025.03.02