简体   繁体   中英

How to make terraform delete an EKS cluster including the AWS resources created by kubernetes?

I use terraform to create an environment in AWS. The environment also contains a EKS cluster, which integrates in AWS and creates some resources there. (For example an ingress will create an application load balancer or a route 53 record. Or a pvc will create a volume.)

What is a good way to make terraform destroy also delete all those depending resources?

Right now I only see destroy time provisioners with some ugly shell scripts.

Is there a more elegant way?

If you use modules like https://github.com/DNXLabs/terraform-aws-eks-lb-controller for ALBs

And terraform modules for the ingresses along with defining your route 53 records in terraform. It will be able to handle this.

Essentially you have to define all that in terraform or use destroy time provisioners to clean it up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM