Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes_ingress_v1 with AWS ALB not Deleting AWS Resources Correctly #2335

Open
cxmiller21 opened this issue Oct 31, 2023 · 5 comments
Open
Labels

Comments

@cxmiller21
Copy link

Terraform Version, Provider Version and Kubernetes Version

Terraform version: 1.6.2
Kubernetes provider version: 2.23.0
Kubernetes version: 1.28

Affected Resource(s)

Panic Output

N/A

Steps to Reproduce

  1. Follow the readme instructions from here: https://github.com/cxmiller21/aws-eks-microservices#deploy-to-aws-eks (cd to ./terraform/eks)
  2. Update TF State bucket with sandbox AWS account bucket
  3. Run terraform apply
  4. Wait for resources to be created
  5. Visit the ALB DNS address/confirm it was created
  6. Run terraform destroy -target kubernetes_ingress_v1.argocd_ingress or terraform destroy

Expected Behavior

Running terraform destroy successfully cleans up the resources it created - an AWS ALB and security group.

Actual Behavior

Running terraform destroy removes the kubernetes_ingress_v1.argocd_ingress resource in terraform but the ALB and security group still exist.

Important Factoids

I don't believe there's anything special going on here

References

I couldn't find any

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@cxmiller21 cxmiller21 added the bug label Oct 31, 2023
@cxmiller21 cxmiller21 changed the title kubernetes_ingress_v1 with AWS ALB not deleting correctly kubernetes_ingress_v1 with AWS ALB not Deleting AWS Resources Correctly Oct 31, 2023
@BBBmau
Copy link
Contributor

BBBmau commented Nov 1, 2023

Hello! Thank you for opening this issue @cxmiller21, could you attempt to delete the resources with just kubectl rather than our provider to see if it produces the same error? The Kubernetes Provider is only sending the Delete request to the Kubernetes Control Plane which is where the actual deletion takes place, so based on this issue the provider isn't what's causing the issue however just to be sure I do want to see what comes from deleting with kubectl instead of deleting with our provider.

@cxmiller21
Copy link
Author

Hi @BBBmau, I was able to run the kubectl delete ing ... command from the cluster and have the AWS ALB and security group delete as expected. I could be missing something on my end or in my configuration and I don't know enough about how the backend provider code looks to really say if it's provider related

@ahoehma
Copy link

ahoehma commented Mar 11, 2024

Any new info's here?
I'm currently facing these effect ... I create a kubernetes-dashboard ingress ... every works fine so far.
(kubernetes/dashboard#8522)
But now I do "tf destroy" and now the whole process hangs while destroying.

@jacekgajek
Copy link

This happened to me as well.

@Atry
Copy link

Atry commented Oct 19, 2024

I think a workaround is to run something like aws-nuke triggered by a destroy-time provisioner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants