terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

kubernetes_ingress_v1 with AWS ALB not Deleting AWS Resources Correctly

Open cxmiller21 opened this issue 2 years ago • 7 comments

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 avatar Oct 31 '23 20:10 cxmiller21

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.

BBBmau avatar Nov 01 '23 15:11 BBBmau

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

cxmiller21 avatar Nov 01 '23 16:11 cxmiller21

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

ahoehma avatar Mar 11 '24 14:03 ahoehma

This happened to me as well.

jacekgajek avatar Apr 11 '24 07:04 jacekgajek