kubernetes-sigs / cluster-api-provider-aws

Kubernetes Cluster API Provider AWS provides consistent deployment and day 2 operations of "self-managed" and EKS Kubernetes clusters on AWS.
http://cluster-api-aws.sigs.k8s.io/
Apache License 2.0
636 stars 561 forks source link

On cluster delete CAPA tries to delete Elastic IPs orphaned from previously deleted cluster with the same name #4120

Closed dlipovetsky closed 1 month ago

dlipovetsky commented 1 year ago

/kind bug

What steps did you take and what happened:

  1. Create an AWS cluster. Delete some of the resources, but orphan the VPC, subnets, NAT gateways, and their Elastic IPs.
  2. Create a new AWS cluster with the same name as the first.
  3. Delete this AWS cluster. Wait for CAPA to report the above error.

When the user deletes the cluster, CAPA reports that it cannot dissociate some Elastic IPs for the cluster:

capa-controller-manager-776c4d9c85-zph9h E0224 20:59:46.735440       1 awscluster_controller.go:248] controller/awscluster "msg"="error deleting network" "error"="failed to disassociate Elastic IP "35.85.118.42" with allocation ID "eipalloc-03fcca3896f78d97f": Still associated with association ID "eipassoc-0d8931f0db75b2f70"" "cluster"="clint-test" "name"="clint-test" "namespace"="kommander-default-workspace" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster" 
Steps to Reproduce:

CAPA attempts to delete Elastic IPs that were orphaned by the previously deleted cluster. This is because the two clusters have the same name, and CAPA filters for Elastic IPs based on the cluster name: https://github.com/kubernetes-sigs/cluster-api-provider-aws//blob/8f4a78422af77744c54173061a8807e63da5d1e9/pkg/cloud/services/network/eips.go#L106-L108

What did you expect to happen: CAPA should attempt to delete only the Elastic IPs that are associated with the new cluster.

Anything else you would like to add: I found this issue with v1.5.2, but the relevant code is the same in v2.0.2.

Environment:

dlipovetsky commented 1 year ago

/triage accepted /priority backlog

Skarlso commented 1 year ago

Is it enough to just check on the tags of the EIP?

k8s-triage-robot commented 6 months ago

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 1 month ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4120#issuecomment-2275420936): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.