The v24.0 release of kubernetes-engine is a backwards incompatible release.
master_global_access
is now supported in GA private-cluster module and defaults to true. To opt out, set master_global_access_enabled
to false
.
module "gke" {
- source = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
- version = "~> 23.0"
+ source = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
+ version = "~> 24.0"
...
+ master_global_access_enabled = false
}
The v24.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.
- Perform a
terraform plan
as normal, identifying therandom_id
resources changing and the newmax_pods_per_node
andpod_range
attributes
~ keepers = { # forces replacement
+ "max_pods_per_node" = ""
+ "pod_range" = ""
# (19 unchanged elements hidden)
}
# (2 unchanged attributes hidden)
}
- Pull the remote state locally:
terraform state pull > default.tfstate
- Back up the original remote state:
cp default.tfstate original.tfstate
- Edit the
random_id
resources to add in the newmax_pods_per_node
andpod_range
attributes from theterraform plan
step
"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": "",
+ "max_pods_per_node": "",
+ "pod_range": ""
},
"prefix": "pool-02-"
}
- Bump the serial number at the top
- Push the modified state to the remote
terraform state push default.tfstate
- Confirm the
random_id
resource no longer changes (or the correspondingnodepool
) in aterraform plan
Minimum Google Provider versions have been updated to 4.42.0
.