diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 066e4191a..17021141c 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -716,8 +716,6 @@ resource "google_container_cluster" "primary" { {% if update_variant %} locals { force_node_pool_recreation_resources = [ - "disk_size_gb", - "disk_type", "accelerator_count", "accelerator_type", "gpu_partition_size", @@ -730,7 +728,6 @@ locals { {% if beta_cluster %} "local_ssd_ephemeral_count", {% endif %} - "machine_type", "placement_policy", "max_pods_per_node", "min_cpu_platform", @@ -738,7 +735,6 @@ locals { "preemptible", "spot", "service_account", - "enable_gcfs", "enable_gvnic", "boot_disk_kms_key", "queued_provisioning", diff --git a/docs/upgrading_to_v35.0.md b/docs/upgrading_to_v35.0.md index 12852dd8b..bd55288bb 100644 --- a/docs/upgrading_to_v35.0.md +++ b/docs/upgrading_to_v35.0.md @@ -6,3 +6,47 @@ The Terraform Kubernetes Engine Module now requires version 6 of the Google Clou ### Private Cluster Sub-Modules Endpoint Output The private cluster sub-modules now return the cluster's private endpoint for the `endpoint` output when the `enable_private_endpoint` argument is `true`, regardless of the `deploy_using_private_endpoint` argument value. + +## Update variant random ID keepers updated + +The v35.0 release updates the keepers for the update variant modules. This will force a recreation of the nodepools. + +To avoid this, it is possible to edit the remote state of the `random_id` resource to add the new attributes. + +1. Perform a `terraform plan` as normal, identifying the `random_id` resource(s) changing and the new/removed attributes +```tf + ~ keepers = { # forces replacement + - "disk_type" = "" -> null + - "disk_size_gb" = "" -> null + - "machine_type" = "" -> null + - "enable_gcfs" = "" -> null + # (19 unchanged elements hidden) + } + # (2 unchanged attributes hidden) + } +``` +2. Pull the remote state locally: `terraform state pull > default.tfstate` +3. Back up the original remote state: `cp default.tfstate original.tfstate` +4. Edit the `random_id` resource(s) to add/remove the attributes from the `terraform plan` step +```diff +"attributes": { + "b64_std": "pool-02-vb4=", + "b64_url": "pool-02-vb4", + "byte_length": 2, + "dec": "pool-02-48574", + "hex": "pool-02-bdbe", + "id": "vb4", + "keepers": { + ... + "taints": "", +- "disk_size_gb": "", +- "enable_gcfs": "", +- "machine_type": "", +- "disk_type": "", + }, + "prefix": "pool-02-" + } +``` +1. Bump the serial number at the top +2. Push the modified state to the remote `terraform state push default.tfstate` +3. Confirm the `random_id` resource(s) no longer changes (or the corresponding `nodepool`) in a `terraform plan` diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index 8633a8fe1..d09352915 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -610,8 +610,6 @@ resource "google_container_cluster" "primary" { *****************************************/ locals { force_node_pool_recreation_resources = [ - "disk_size_gb", - "disk_type", "accelerator_count", "accelerator_type", "gpu_partition_size", @@ -622,7 +620,6 @@ locals { "enable_integrity_monitoring", "local_ssd_count", "local_ssd_ephemeral_count", - "machine_type", "placement_policy", "max_pods_per_node", "min_cpu_platform", @@ -630,7 +627,6 @@ locals { "preemptible", "spot", "service_account", - "enable_gcfs", "enable_gvnic", "boot_disk_kms_key", "queued_provisioning", diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index 2497ab771..471865dc7 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -589,8 +589,6 @@ resource "google_container_cluster" "primary" { *****************************************/ locals { force_node_pool_recreation_resources = [ - "disk_size_gb", - "disk_type", "accelerator_count", "accelerator_type", "gpu_partition_size", @@ -601,7 +599,6 @@ locals { "enable_integrity_monitoring", "local_ssd_count", "local_ssd_ephemeral_count", - "machine_type", "placement_policy", "max_pods_per_node", "min_cpu_platform", @@ -609,7 +606,6 @@ locals { "preemptible", "spot", "service_account", - "enable_gcfs", "enable_gvnic", "boot_disk_kms_key", "queued_provisioning", diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 3878a8741..a70c2e273 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -563,8 +563,6 @@ resource "google_container_cluster" "primary" { *****************************************/ locals { force_node_pool_recreation_resources = [ - "disk_size_gb", - "disk_type", "accelerator_count", "accelerator_type", "gpu_partition_size", @@ -574,7 +572,6 @@ locals { "enable_secure_boot", "enable_integrity_monitoring", "local_ssd_count", - "machine_type", "placement_policy", "max_pods_per_node", "min_cpu_platform", @@ -582,7 +579,6 @@ locals { "preemptible", "spot", "service_account", - "enable_gcfs", "enable_gvnic", "boot_disk_kms_key", "queued_provisioning",