Repository navigation
fix(aws): clean up Classic ELB and its Security Group on EKS cluster delete - #1796
Merged
cb-spider merged 1 commit intoAug 10, 2026
Conversation
…delete DeleteCluster() only called eks.DeleteCluster and returned, so any Classic ELB (and its dedicated k8s-elb-* Security Group) that the Kubernetes in-tree AWS cloud provider auto-created for a type=LoadBalancer Service was left behind. This kept the cluster's subnets in-use, blocking subsequent Subnet/VPC deletion. DeleteCluster() now looks up the cluster's VPC before deleting, then after a successful delete finds any Load Balancer tagged kubernetes.io/cluster/<name>=owned in that VPC and removes it along with its Security Group. Best-effort: failures are logged but never turn an already-successful cluster deletion into an error, and unrelated Load Balancers/Security Groups in the same VPC are left untouched. Verified against a real EKS 1.31 cluster in ap-northeast-2: a Service(LoadBalancer)-created Classic ELB and its Security Group are removed on cluster delete, an unrelated ELB in the same VPC survives, and clusters with no Load Balancer or nonexistent clusters delete the same as before. Fixes cloud-barista#1208
cb-spider
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1208 — the Classic ELB (and its associated Security Group) provisioned for a PMKS/EKS cluster's control plane was left behind after cluster deletion, causing orphaned AWS resources.
Test plan