Terraform: delete loadbalancer created by k8s



I wonder how can I delete a load balancer created on Kapsule as described here: https://www.scaleway.com/en/docs/using-a-load-balancer-to-expose-your-kubernetes-kapsule-ingress-controller-service/

Thing is, I am creating everything via Terraform. So if I apply a terraform destroy, the LB is not destroyed, since it isn’t a terraform resource. How can it be deleted?





If you have destroyed your Terraform infrastructure and you have no longer need for the load balancer, you can delete it from the Load Balancer section of your Scaleway Console by clicking on the Loadbalancer -> Delete or by using the API: https://developers.scaleway.com/en/products/lb/api/#delete-264417



Thanks, but that defeats the purpose of automating things with Terraform…


Hey @francis !
A new flag is available on the cluster destruction to destroy all associated resources (LBs, IPs and block storage). It’s not available yet in TF but I’ll try to add it next week!


Great @PatrikCyvoct ! But I hope there’s a way to make it optional to destroy the IP’s, since the cool thing is actually to be able to reuse IP’s, specially when they are already pointed to from DNS.


On the delete nop it’s all or nothing, at least for now. But with IP datasource in TF it should work well I think :slight_smile: