nlamirault / terraform-digitalocean-doks

Terraform module for Digital Ocean Kubernetes (DOKS)
8 stars 8 forks source link

Variable node_count overrides autoscaling #12

Closed the-technat closed 2 years ago

the-technat commented 2 years ago

Hey there!

Thank you very much for your module, I'm using it here and it works well.

I'm not sure if you could call it a bug but based on my experience with the module I have discovered that Terraform resets the number of worker nodes to node_count when a subsequent run is triggered. This causes unnecessary scalings as the applications deployed on the cluster will immediately trigger a new scale up after Terraform has scaled down.

I've tried to fix this by setting the node_count to 0 when auto_scaling is enabled, but it didn't work as the node_count needs to be at least 1. Seems like the only way to really "fix" this is to remove the node_count attribute in cluster.tf. A dirty workaround I could imagine would be to have two cluster resources and use count to enable and disable one of them based on the auto_scaling var.

Any inputs on that? Would it be an option to remove the node_count var?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.