Skip to content

Commit

Permalink
Merge branch 'master' into ap/endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Dec 5, 2024
2 parents 17e400c + 276cbdb commit 8515153
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 16 deletions.
4 changes: 0 additions & 4 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,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",
Expand All @@ -739,15 +737,13 @@ locals {
{% if beta_cluster %}
"local_ssd_ephemeral_count",
{% endif %}
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
"preemptible",
"spot",
"service_account",
"enable_gcfs",
"enable_gvnic",
"boot_disk_kms_key",
"queued_provisioning",
Expand Down
44 changes: 44 additions & 0 deletions docs/upgrading_to_v35.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
4 changes: 0 additions & 4 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ resource "google_container_cluster" "primary" {
*****************************************/
locals {
force_node_pool_recreation_resources = [
"disk_size_gb",
"disk_type",
"accelerator_count",
"accelerator_type",
"gpu_partition_size",
Expand All @@ -631,15 +629,13 @@ locals {
"enable_integrity_monitoring",
"local_ssd_count",
"local_ssd_ephemeral_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
"preemptible",
"spot",
"service_account",
"enable_gcfs",
"enable_gvnic",
"boot_disk_kms_key",
"queued_provisioning",
Expand Down
4 changes: 0 additions & 4 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -601,15 +599,13 @@ locals {
"enable_integrity_monitoring",
"local_ssd_count",
"local_ssd_ephemeral_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
"preemptible",
"spot",
"service_account",
"enable_gcfs",
"enable_gvnic",
"boot_disk_kms_key",
"queued_provisioning",
Expand Down
4 changes: 0 additions & 4 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,6 @@ resource "google_container_cluster" "primary" {
*****************************************/
locals {
force_node_pool_recreation_resources = [
"disk_size_gb",
"disk_type",
"accelerator_count",
"accelerator_type",
"gpu_partition_size",
Expand All @@ -583,15 +581,13 @@ locals {
"enable_secure_boot",
"enable_integrity_monitoring",
"local_ssd_count",
"machine_type",
"placement_policy",
"max_pods_per_node",
"min_cpu_platform",
"pod_range",
"preemptible",
"spot",
"service_account",
"enable_gcfs",
"enable_gvnic",
"boot_disk_kms_key",
"queued_provisioning",
Expand Down

0 comments on commit 8515153

Please sign in to comment.