cluster-api-provider-aws
cluster-api-provider-aws copied to clipboard
On cluster delete CAPA tries to delete Elastic IPs orphaned from previously deleted cluster with the same name
/kind bug
What steps did you take and what happened:
- Create an AWS cluster. Delete some of the resources, but orphan the VPC, subnets, NAT gateways, and their Elastic IPs.
- Create a new AWS cluster with the same name as the first.
- 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:
- Cluster-api-provider-aws version: v1.5.2
- Kubernetes version: (use
kubectl version): n/a - OS (e.g. from
/etc/os-release): n/a
/triage accepted /priority backlog
Is it enough to just check on the tags of the EIP?
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
- Confirm that this issue is still relevant with
/triage accepted(org members only) - Close this issue with
/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted