terraform-provider-digitalocean
terraform-provider-digitalocean copied to clipboard
Multiple Kubernetes node pools
Just accidentally wiped out my k8s cluster for the second time trying to mess with node pools (not complaining, just setting the stage- its a side project. Would have been more careful if it was a big deal).
- A cluster requires exactly 1 node pool
- You can add other node pools external to the cluster resource, but you can't add multiple to the cluster resource
- Changing the default node pool triggers a replacement of the cluster resource
Now, if I want to resize the default node pool I can create a second pool and delete the first using the console, and it will work properly. But the terraform provider doesn't support that workflow. Doing it manually just leads to my state getting out of sync and terraform deleting the cluster anyway.
Suggestion: Allow multiple node_pool blocks on the cluster, so you can add new ones and delete old ones. Change the logic so replacement of the cluster is never required for this- even replacing a node pool should be done by adding then deleting.
https://www.terraform.io/docs/providers/do/r/kubernetes_node_pool.html
If you were trying to say I missed something, I said "You can add other node pools external to the cluster resource, but you can't add multiple to the cluster resource". I know that you can add others. My problem is that there is no way to remove/replace the one attached to the cluster resource, even though the digital ocean API allows such a thing.
I also would like the default node pool to not force the entire k8s cluster to be remade if I have to resize it. I'd prefer for the node pool to be optional so I can attach separate node pools, which in turn would prevent resizing of a node pool to destroy/create my entire k8s cluster.