Skip to content

Latest commit

 

History

History
executable file
·
63 lines (34 loc) · 3.08 KB

098-Error-Failing-to-delete-cloudformation-stack.md

File metadata and controls

executable file
·
63 lines (34 loc) · 3.08 KB

Error: Failing to Delete CloudFormation Stack

Problem

When you try to delete the cluster using the command below, you get an error that says it failed to delete the cluster.

$ eksctl delete cluster -f manifest.yml 

When you go to > CloudFormation dashboard > Stacks > eksctl-yourcluster, and then check the Events, you might see this two errors:

When CloudFormation tries to create the node instance profile:

Resource handler returned message: "User: arn:aws:iam::12345678910:user/k8s-admin is not authorized to perform: iam:RemoveRoleFromInstanceProfile on resource: instance profile eksctl-eksops-nodegroup-mynodegroup-NodeInstanceProfile-qNlJ2ojEWOdP because no identity-based policy allows the iam:RemoveRoleFromInstanceProfile action (Service: Iam, Status Code: 403, Request ID: b90e26ea-97ff-453b-8e4d-8353c39a3a9b, Extended Request ID: null)" (RequestToken: 139ad70a-2b04-9797-697d-85530cb2496b, HandlerErrorCode: GeneralServiceException) 

After the stack failed, CloudFormation tried to rollback but fails to delete the node instance profile:

Resource handler returned message: "User: arn:aws:iam::12345678910:user/k8s-admin is not authorized to perform: iam:CreateInstanceProfile on resource: arn:aws:iam::12345678910:instance-profile/eksctl-eksops-nodegroup-mynodegroup-NodeInstanceProfile-qNlJ2ojEWOdP because no identity-based policy allows the iam:CreateInstanceProfile action (Service: Iam, Status Code: 403, Request ID: 8f3b2448-5ff3-40b9-80c8-12aeb56eb692, Extended Request ID: null)" (RequestToken: 0b93aa73-eb81-1650-0f47-56a3a476f5b3, HandlerErrorCode: GeneralServiceException)

Cause

Your IAM user account doesn't have the needed permissions.

Solution

As I have had many attempts in resolving the issue, the best option is to create the cluster with the IAM user that has an AdministratorAccess. This isn't recommended but this completely solves the issue.

You may also refer to the EKSFullAccess policy file that I have created. It contains the minimum AWS IAM permissions to do EKS operations using eksctl and kubectl.

You may also check out these links:


Back to first page