cannot run kubectl commands in deployment scripts

0

I am trying to run kubectl commands through deployment scripts in codebuild. A build pipeline service role is created with appropriate permissions. However, while executing the kubectl commands, it gives permission denied error. What am I missing?

질문됨 10달 전321회 조회
1개 답변
2
수락된 답변

I understand that you are running kubectl command in your codebuild buildspec , so you need to make sure that your IAM service role used by your codebuild is added in aws-auth config map of eks cluster.

Let's say, your codebuld service arn is "arn:aws:iam::<account number>:role/service-role/codebuild-test-service-role", then role arn without path (ex. "arn:aws:iam::<account number>:role/codebuild-test-service-role") need to be added in aws-auth configmap of EKS Cluster.

To provide the access to IAM role in aws-auth configmap, you can refer AWS document, which will help to understand how aws-auth configmap can be updated.

Hope this helps.

AWS
지원 엔지니어
답변함 10달 전
profile picture
전문가
검토됨 10달 전
profile picture
전문가
검토됨 10달 전
profile picture
전문가
검토됨 10달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인