eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

[Bug] Cleanup not possible for cluster stack

Open errordeveloper opened this issue 1 year ago • 3 comments

What were you trying to accomplish?

I am trying to clean up a cluster that wasn't created successfully.

What happened?

I ran eksctl create cluster and it failed with this error:

2024-04-05 11:20:03 [ℹ]  building cluster stack "eksctl-ilya-test2g-cluster"
2024-04-05 11:20:04 [ℹ]  deploying stack "eksctl-ilya-test2g-cluster"
2024-04-05 11:20:34 [ℹ]  waiting for CloudFormation stack "eksctl-ilya-test2g-cluster"
2024-04-05 11:20:34 [✖]  unexpected status "ROLLBACK_IN_PROGRESS" while waiting for CloudFormation stack "eksctl-ilya-test2g-cluster"
2024-04-05 11:20:34 [✖]  unexpected status "ROLLBACK_IN_PROGRESS" while waiting for CloudFormation stack "eksctl-ilya-test2g-cluster"
2024-04-05 11:20:34 [ℹ]  fetching stack events in attempt to troubleshoot the root cause of the failure
2024-04-05 11:20:34 [!]  AWS::EC2::VPC/VPC: DELETE_IN_PROGRESS
2024-04-05 11:20:34 [!]  AWS::IAM::Role/ServiceRole: DELETE_IN_PROGRESS
2024-04-05 11:20:34 [!]  AWS::EC2::InternetGateway/InternetGateway: DELETE_IN_PROGRESS
2024-04-05 11:20:34 [✖]  AWS::EC2::VPC/VPC: CREATE_FAILED – "Resource creation cancelled"
2024-04-05 11:20:34 [✖]  AWS::IAM::Role/ServiceRole: CREATE_FAILED – "Resource creation cancelled"
2024-04-05 11:20:34 [✖]  AWS::EC2::InternetGateway/InternetGateway: CREATE_FAILED – "Resource creation cancelled"
2024-04-05 11:20:34 [✖]  AWS::EC2::EIP/NATIP: CREATE_FAILED – "Resource handler returned message: \"The maximum number of addresses has been reached. (Service: Ec2, Status Code: 400, Request ID: a4376182-05c8-429e-99b8-1061001c46db)\" (RequestToken: 66fcc5d8-2186-a4f7-286d-3ce3f6eaa50b, HandlerErrorCode: GeneralServiceException)"
2024-04-05 11:20:34 [!]  1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console
2024-04-05 11:20:34 [ℹ]  to cleanup resources, run 'eksctl delete cluster --region=eu-west-3 --name=ilya-test2g'
2024-04-05 11:20:34 [✖]  ResourceNotReady: failed waiting for successful resource state
Error: failed to create cluster "ilya-test2g"

If I copy the suggested command, which used to to work, it doesn't actually let me cleanup the cluster:

$ eksctl delete cluster --region=eu-west-3 --name=ilya-test2g
Error: unable to describe cluster control plane: operation error EKS: DescribeCluster, https response error StatusCode: 404, RequestID: 840c85fa-7649-4841-9eba-759621abd61d, ResourceNotFoundException: No cluster found for name: ilya-test2g.
$

errordeveloper avatar Apr 05 '24 10:04 errordeveloper

It would be nice if eksctl delete cluster was able to clean up failed CloudFormation stacks. It used to be possible but had been blocked since the direct call to DescribeCluster was introduced.

errordeveloper avatar Apr 05 '24 10:04 errordeveloper

Hi @errordeveloper, eksctl delete cluster supports a force flag that ignores errors and continues with the deletion process. Although I do agree that the delete command without any extra options should specifically handle deleting a non-existent cluster that has a CloudFormation stack.

cPu1 avatar Apr 08 '24 09:04 cPu1

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 09 '24 01:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar May 15 '24 01:05 github-actions[bot]