FlexibleEngineCloud / terraform-provider-flexibleengine

Terraform flexibleengine provider
https://www.terraform.io/docs/providers/flexibleengine/
Mozilla Public License 2.0
30 stars 53 forks source link

CCE : initial_node_count should not trigger scale down #975

Closed gbrd closed 1 year ago

gbrd commented 1 year ago

I use CCE

I also use the autoscaler.

Here is the scenario :

How can I set initial value (required by terraform provider) to 1 by tell it not to be changed later if autoscaler decided to change it.

Expected Behavior

node_pool not touched (initial_node_count should only be used on creation)

Actual Behavior

node_pool forced to count = initial_node_count

Steps to Reproduce

Create a node_pool with initial_node_count=1 via terraform add some pods to have autoscaler scale it to 2 nodes run terraform apply again

ShiChangkuo commented 1 year ago

Sorry for the delay!

The issue will be fixed in the next release in the next week.

Now, you can add lifecycle block in node pool resource as a workaround:

resource "flexibleengine_cce_node_pool_v3" "pool" {
  # ...

  lifecycle {
    ignore_changes = [
      initial_node_count,
    ]
  }
}