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

GKE Autoscaling NodePool continually resets its node count when initNodeCount is set, but nodeCount is not #516

Open
dilyankostov opened this issue Jan 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dilyankostov
Copy link

dilyankostov commented Jan 2, 2024

What happened?

I'm creating GKE NodePools with autoscaling enabled and initialNodeCount slightly higher than the min. However, when the nodepool scales down naturally, crossplane automatically ups it to the initial value.

Screenshot 2024-01-02 at 14 55 03

The Managed Resource sets Node Count! for some reason

Spec:                                                                                                                                   │
│   For Provider:                                                                                                                         │
│     Autoscaling:                                                                                                                        │
│       Max Node Count:    4                                                                                                              │
│       Min Node Count:    0                                                                                                              │
│     Initial Node Count:  4                                                                                                              │
│     Node Count:         4 
....

I execed into the provider-gcp pod, found the resource and did terraform init/plan which gave me

# google_container_node_pool.control-plane-xxx-xxx will be updated in-place
  ~ resource "google_container_node_pool" "control-plane-xxx-xxx" {
        id                          = "projects/xxx/locations/xxx/clusters/xxx/nodePools/xxxx"
        name                        = "xxxx"
      ~ node_count                  = 0 -> 4
        # (9 unchanged attributes hidden)

So Crossplane is setting the node_count even though I do not set the nodeCount field.

How can we reproduce it?

Create a GKE cluster with a Node pool with config

              apiVersion: container.gcp.upbound.io/v1beta1
              kind: NodePool
              spec:
                forProvider:
                  initialNodeCount: 4
                  autoscaling:
                    - maxNodeCount: 4
                      minNodeCount: 0
                  nodeConfig...

What environment did it happen in?

I've reproduced this running crossplane both on a local kind cluster and a GKE cluster.

provider-gcp-container:v0.38.1
provider-gcp-compute:v0.38.1

helmReleaseName = "upbound-stable/universal-crossplane"
helmName = "uxp"
helmRepo = "upbound-stable"
helmRepoUrl = "https://charts.upbound.io/stable"
version = "v1.14.3-up.1"

@dilyankostov dilyankostov added the bug Something isn't working label Jan 2, 2024
@dilyankostov dilyankostov changed the title GKE Autoscaling NodePool gets its node count reset by Crossplane when initNodeCount is set, but nodeCount is not GKE Autoscaling NodePool continually resets its node count when initNodeCount is set, but nodeCount is not Jan 2, 2024
@roldyxoriginal
Copy link

roldyxoriginal commented Jun 11, 2024

@dilyankostov you need set managementPolicy!!!!!!!!!!!
Something like this:

apiVersion: container.gcp.upbound.io/v1beta1
kind: NodePool
metadata:
  name: test1
spec:
  managementPolicies:
  - Create
  - Update
  - Observe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants