aws / aws/containers-roadmap

[EKS] [request]: Automatic clean-up of Kubernetes-provisioned AWS resources on cluster deletion

Open
#1,348 3 comments 72 reactions 0 assignees View on GitHub
EKS Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**
Deleting a cluster should automatically clean-up any AWS resources that were provisioned by Kubernetes controllers.

**Which service(s) is this request for?**
EKS

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
The most common scenario is when you have Kubernetes Services of Type=LoadBalancer, which results in LBs being provisioned.
Once you delete the cluster, the LBs remain and have to be cleaned-up manually if you e.g. want to also destroy the subnets. This likely also applies to other third-party controllers/operators that manage external resources.

The below workarounds are not great, as they don't work well in an Infrastructure-as-Code managed environment. I think fixing this would give EKS better support for ephemeral clusters.
Also, it appears that AKS is able to handle this.

**Are you currently working around this issue?**
For load balancers, there are currently two ways of handling this:
- Delete all Services (of Type: LoadBalancer) and wait for resources to be cleaned up prior to EKS deletion
- Script / manual cleanup after cluster deletion

**Additional context**
Prior discussions/reports: https://github.com/kubernetes/kubernetes/issues/93390

Contributor guide

Open the contributing guide

Research direction

No repository files, tests, or implementation entry points are identified in the issue. Start by reading the Kubernetes prior discussion linked in the issue and investigating how EKS handles Services of Type=LoadBalancer and other controller-managed external resources; done should mean cluster deletion reliably cleans up those resources without manual pre- or post-deletion steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, kubernetes
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.