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 permadiff/thrashing when update_settings values are updating #13157

Comments

@rileykarson
Copy link
Collaborator

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

$ terraform -v
Terraform v1.3.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.44.1

I believe the bug to have been introduced in 4.44.0, by hashicorp/terraform-provider-google-beta#4860

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

provider "google" {
  version = "~> 4.44.1"
}

resource "google_container_cluster" "cluster" {
  name               = "my-surge"
  location           = "us-central1-a"
  initial_node_count = 3
}

resource "google_container_node_pool" "np1" {
  name               = "my-surge"
  location           = "us-central1-a"
  cluster            = google_container_cluster.cluster.name
  initial_node_count = 2
  upgrade_settings {
    max_surge = 2
-    max_unavailable = 1
+    max_unavailable = 2
  }
}

Debug Output

---[ REQUEST ]---------------------------------------
PUT /v1/projects/my-project/locations/us-central1-a/clusters/my-surge/nodePools/my-surge?alt=json&prettyPrint=false HTTP/1.1
Host: container.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.3.2 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
Content-Length: 60
Content-Type: application/json
X-Goog-Api-Client: gl-go/1.18.1 gdcl/0.102.0
Accept-Encoding: gzip

{
 "upgradeSettings": {
  "maxUnavailable": 2,
  "strategy": "SURGE"
 }
}

Panic Output

N/A

Expected Behavior

My cluster should update max_unavailable while preserving max_surge

Actual Behavior

max_surge was set to zero, and a diff was published

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # google_container_node_pool.np1 will be updated in-place
  ~ resource "google_container_node_pool" "np1" {
        id                          = "projects/graphite-test-rileykarson/locations/us-central1-a/clusters/my-surge/nodePools/my-surge"
        name                        = "my-surge"
        # (9 unchanged attributes hidden)

      ~ upgrade_settings {
          ~ max_surge       = 0 -> 2
            # (2 unchanged attributes hidden)
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

Using the configuration above:

  1. terraform apply with max_available equal to 1
  2. terraform apply with max_available equal to 2
  3. Keep running terraform apply over and over again

Important Factoids

References

@github-actions
Copy link

github-actions bot commented Jan 5, 2023

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.