Will terraform try to upgrade my gke nodes and master if I dont set master_version and node_version?

12/10/2018

https://www.terraform.io/docs/providers/google/r/container_cluster.html

Just want to make sure I understand this.

If I create a gke cluster and don't specify master_version and node_version terraform will let gke use the latest version.

Lets say I run terraform apply again a month from now. GKE's default master version will be newer. Will terraform try to upgrade the gke cluster to the latest version if the version isnt pinned with master_version?

-- red888
google-cloud-platform
google-kubernetes-engine
kubernetes
terraform

1 Answer

12/10/2018

You have your answer inside the documentation:

min_master_version - (Optional) The minimum version of the master. GKE will auto-update the master to new versions, so this does not guarantee the current master version--use the read-only master_version field to obtain that. If unset, the cluster's version will be set by GKE to the version of the most recent official release (which is not necessarily the latest version).

Meaning that if you don't give it a minimal version it will simply put the latest master version and continue doing the updates automaticaly, so if you run terraform it won't try to update the master as it should already be in the last version.

-- night-gold
Source: StackOverflow