Eksctl: Unable to re-create a cluster with the same Name, after deleting it from AWS Console

Created on 7 Apr 2020  路  4Comments  路  Source: weaveworks/eksctl

I am trying to re-create a cluster with the same name I previously created (via eksctl) and deleted by using the AWS Console.

I believe it is related to Issue #1386
https://github.com/weaveworks/eksctl/issues/1386

I added my comments and logs in the comments section

https://github.com/weaveworks/eksctl/issues/1386#issuecomment-610611065

kinhelp

Most helpful comment

AWS Support provided work around:

Deletion:
ii) Deletion of Eks cluster from web console is successful.If you delete the cluster using webconsole it will not delete the backend stack(eksctl-damltest1-cluster).In our case Eks cluster got successfully deleted but backend CloudFormation stack(eksctl-damltest1-cluster) still exists.

Recreation:
iii) While creating Eks cluster with same name using Eks tool you may see the following error , The error is due to CloudFormation stack exists with name eksctl-damltest1-cluster from the initial creation.

"creating CloudFormation stack "eksctl-damltest1-cluster": AlreadyExistsException: Stack [eksctl-damltest1-cluster] already exists status code: 400"

I would request you to delete CloudFormation stack eksctl-damltest1-cluster from web console[1] and then create Eks cluster with same name("damltest1"). As of now i see Stack deletion got failed because of VPC, Subnet , Internet gateway dependency error. Since the state of the Stack in DELETE_FAILED state , you can delete the stack from console and skip the resources that are having dependency. Skipping the resources will delete the Stack completely and allow you to create new Eks cluster with same name using Eksctl tool.

As a second way of work around you can create the EKs cluster with same name using Web console.As you may know we can create Eks cluster using web console please refer to the link[2].As best practice managing the EKS cluster using "eksctl" tool will be preferred to create a cluster. This way the deletion will also trigger a deletion to the CloudFromation stack launched during the creation. However as stack failures can happen, it is best to confirm cfn stacks have been deleted from the console/awscli as well.

If you have any other queries or come across any issues, please let us know. For direct assistance and troubleshooting, please initiate a phone call or chat.

Refernces:
[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-delete-stack.html
[2] https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html
[3] https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

All 4 comments

AWS Support provided work around:

Deletion:
ii) Deletion of Eks cluster from web console is successful.If you delete the cluster using webconsole it will not delete the backend stack(eksctl-damltest1-cluster).In our case Eks cluster got successfully deleted but backend CloudFormation stack(eksctl-damltest1-cluster) still exists.

Recreation:
iii) While creating Eks cluster with same name using Eks tool you may see the following error , The error is due to CloudFormation stack exists with name eksctl-damltest1-cluster from the initial creation.

"creating CloudFormation stack "eksctl-damltest1-cluster": AlreadyExistsException: Stack [eksctl-damltest1-cluster] already exists status code: 400"

I would request you to delete CloudFormation stack eksctl-damltest1-cluster from web console[1] and then create Eks cluster with same name("damltest1"). As of now i see Stack deletion got failed because of VPC, Subnet , Internet gateway dependency error. Since the state of the Stack in DELETE_FAILED state , you can delete the stack from console and skip the resources that are having dependency. Skipping the resources will delete the Stack completely and allow you to create new Eks cluster with same name using Eksctl tool.

As a second way of work around you can create the EKs cluster with same name using Web console.As you may know we can create Eks cluster using web console please refer to the link[2].As best practice managing the EKS cluster using "eksctl" tool will be preferred to create a cluster. This way the deletion will also trigger a deletion to the CloudFromation stack launched during the creation. However as stack failures can happen, it is best to confirm cfn stacks have been deleted from the console/awscli as well.

If you have any other queries or come across any issues, please let us know. For direct assistance and troubleshooting, please initiate a phone call or chat.

Refernces:
[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-delete-stack.html
[2] https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html
[3] https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

Was also getting the error:
[鉁朷 creating CloudFormation stack "eksctl-xxx-cluster": AlreadyExistsException: Stack [eksctl-xxx-cluster] already exists
status code: 400, request id: 93fb0c2e-039b-44d2-xxx-xxxxxxxxx
eksctl create ... worked again when I deleted the relevant CloudFormation stack on AWS.

Shouldn't this be an open issue? Isn't the solution provided above a workaround?

@termlen0 The solution is just to delete the eksctl stack(s) from the AWS console, not only the EKS cluster.
eksctl won't delete the stack(s) in general because it's useful to have to the stack to debug issues and even if it tried, in some cases the stack might still end up in DELETE_FAILED.

Was this page helpful?
0 / 5 - 0 ratings