Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create autoscaling clusters without setting (initial_)node_count #742

Closed
drzero42 opened this issue Nov 15, 2017 · 2 comments
Closed
Assignees
Labels
bug forward/review In review; remove label to forward service/container

Comments

@drzero42
Copy link
Contributor

Terraform Version

  • Terraform v0.10.8
  • Terraform-provider-google v1.2.0

Affected Resource(s)

  • google_container_cluster

If I want to create a cluster where the default node pool has autoscaling enabled, I have to specify the node_pool, because the autoscaling sub is part of the node_pool schema. However, when autoscaling is enabled and min/max node count is set, it makes no sense to set node_count (with initial_node_count being deprecated), as that value changes when the cluster autoscales. Even though node_count is marked as optional, the expandNodePool function throws this error message: Node pool default-pool cannot be set with 0 node count if I don't set node_count.
I suggest that expandNodePool also checks if autoscaling is enabled, and don't complain about node_count == 0 if it is. Right now, I basically have to keep using initial_node_count, if I want this to work. Maybe have the code automatically set initial_node_count = 1 or something, when autoscaling is enabled.

Example HCL that will trigger this problem:

resource "google_container_cluster" "cluster" {
  name = "cluster"
  zone = "europe-west1-b"

  node_pool {
    name = "default-pool"
    autoscaling {
      min_node_count = 0
      max_node_count = 5
    }
  }
}
@danawillow
Copy link
Contributor

Fixed in #752.

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Sep 27, 2019
Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
@github-actions github-actions bot added service/container forward/review In review; remove label to forward labels Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug forward/review In review; remove label to forward service/container
Projects
None yet
Development

No branches or pull requests

3 participants