Open uniglot opened 1 year ago
Can someone confirm whether this is an expected behavior?
I assumed terraform destroy
would also destroy the Droplets created via the required node_pool
configuration as well.
Issuing a terraform destroy
should indeed destroy the Droplets associated with the cluster's node pools. Though Terraform does not manage those Droplets directly. The destroy command makes an API request to the DigitalOcean Kubernetes Service's (DOKS) API. DOKS should then destroy the Droplets that are part of the cluster. This is an asynchronous operation that may take some time to complete.
Are these Droplets being left indefinitely or do they eventually go away?
@andrewsomething Let me try again in a few days and then I can tell you whether the Droplets eventually get destroyed.
I came to the same problem. My expectation that terraform destroy waits for node pool finish clear all droplets before exit.
In my case the droplet was there after 1 minute of kubernetes destroyed.
Bug Report
Describe the bug
Issuing a
terraform destroy
command on a "digitalocean_kubernetes_cluster" resource which doesn't have additional Nodepools removes the cluster, but the Droplets in the default Nodepool were not removed.I found this behavior from the fact that creating the cluster took 5m30s but for destroying it 1s was enough.
After checking out the DO console, I found out that the Droplets were not removed and still running.
Affected Resource(s)
Expected Behavior
Upon issuing a
terraform destory
command on the cluster's resource, I expected the Droplets which were in the default Nodepool should be removed along with the cluster.Actual Behavior
The Droplets in the default Nodepool were not removed and still running.
Steps to Reproduce
terraform apply
including the resource declaration below:which should work well.
terraform destroy
and the generated plan will be similar to:Terraform Configuration Files
Terraform version
Debug Output
Panic Output
Additional context
resourceDigitalOceanKubernetesClusterDelete()
usesclient.Kubernetes.Delete()
(link)`, which corresponds to this API endpoint. The reference says that this endpoint is used to delete a Kubernetes cluster and all services deployed to it.Important Factoids
References