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

Ressource google_container_cluster shouldn't delete and create cluster after image_type change #1702

Closed
etlfg opened this issue Jun 26, 2018 · 1 comment
Labels
enhancement forward/review In review; remove label to forward service/container

Comments

@etlfg
Copy link

etlfg commented Jun 26, 2018

Terraform Version

$ terraform -v
Terraform v0.11.7

Affected Resource(s)

google_container_cluster

Terraform Configuration Files

resource "google_container_cluster" "primary" {
  name = "${var.name}"
  zone = "${var.zone}"
  initial_node_count = "${var.node_count}"
  min_master_version = "${var.min_master_version}"
  node_version = "${var.node_version}"
  
  image_type = "COS" # Change this to "Ubuntu"

  node_config {
    disk_size_gb = "${var.disk_size_gb_node}"
    machine_type = "${var.machine_type_node}"
  }
}

Expected Behavior

We should be able to change the image_type of a cluster without deleting it. GCP already manages to do It by updating one node after the other and by provisioning the workload on the others.

Actual Behavior

Terraform plans to destroy and recreate the cluster.

-/+ destroy and then create replacement

Terraform will perform the following actions:

-/+ google_container_cluster.primary (new resource required)

...

node_config.0.image_type:              "UBUNTU" => "COS" (forces new resource)
...

However this feature is designed on GCP side since you're able to do It on the web UI. screenshot from 2018-06-25 18-33-55

It is also possible from the gcloud cli :
gcloud container clusters upgrade --image-type [IMAGE_TYPE] [CLUSTER_NAME] [--node-pool [POOL_NAME]]
See the doc for more information about this.

The call seems to be done with a POST to https://console.cloud.google.com/m/operations?organizationId=<orgId>&operationType=cloud-console.container.updateCluster&pid=<envName> with desiredNodePoolImageType set to "COS" in the params.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. switch image_type from Ubuntu or Cos accordingly to the first applied image
  3. terraform plan

References

Seems to be related to :

@etlfg etlfg changed the title ressource google_container_cluster shouldn't delete and create cluster after image_type change Ressource google_container_cluster shouldn't delete and create cluster after image_type change Jun 26, 2018
danawillow added a commit that referenced this issue Aug 7, 2018
Fixes #1702.

@chrisst I'm putting you as a reviewer, but no rush. Feel free to ask as many questions as you have! Also feel free to offer suggestions 😃 (or just say it's perfect as-is, that works too)
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this issue Nov 9, 2018
Fixes hashicorp#1702.

@chrisst I'm putting you as a reviewer, but no rush. Feel free to ask as many questions as you have! Also feel free to offer suggestions 😃 (or just say it's perfect as-is, that works too)
@ghost
Copy link

ghost commented Nov 17, 2018

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 17, 2018
@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
enhancement forward/review In review; remove label to forward service/container
Projects
None yet
Development

No branches or pull requests

2 participants