awslabs / aws-eks-cluster-controller

Manages EKS clusters in different AWS accounts using Custom Resources
Apache License 2.0
103 stars 30 forks source link

EKS will now delete components with label "eks.needsdeleting":"true", #45

Closed MadVikingGod closed 5 years ago

MadVikingGod commented 5 years ago

Components defined in the pkg/controller/eks/components.go will now be deleted if they have the correct label. This will happen before removing the nodegroups or cluster to allow for any remote operators to clean up any existing resources.

Components were made to stick around until the remote object is deleted.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ckrough commented 5 years ago

@MadVikingGod

What are your thoughts on making the label more of an identifier rather than a todo task? Meaning, rather than specifying a todo task like "needsdeleting" we tag it with a label that identifies it as part of an inventory so that the action being taken is isolated to the process doing the cleanup, rather then exposing that intent in a label? It's up to the cleanup process to know which inventory items it cares about.

MadVikingGod commented 5 years ago

We would still need a label to differentiate it from the resources that don't need to be, or shouldn't be deleted. Do you have any suggestions on what you would want this label to be?

In a situation with resource A, B, and C. Where A and C can be cleaned up by turning off the cluster, but B needs to be explicitly deleted (it has an API Gateway), and depends on A for clean up. We would like the delete logic to be able to tell that B needs to be deleted.

MadVikingGod commented 5 years ago

@tantona I added a number of tests. Could you give it a look when you get a chance.