Review GKE version support and updates

Older GKE versions can increase exposure to known vulnerabilities and end-of-support risks.

Description

Read master_version for the running GKE control-plane version. min_master_version sets a minimum. Check each node pool as well and use versions that receive security fixes for the cluster’s location and release channel.

Potential impact

An unsupported version can retain known vulnerabilities. A node version incompatible with the control plane can also disrupt workloads.

Remediation

Choose a supported version available in the location and channel. Review the upgrade policy and maintenance window, test the application, then verify the running control-plane and node-pool versions after upgrading.

Examples

The example’s 1.24 is out of support. Declare var.gke_version and supply the version you tested. The second excerpt uses it for the control-plane minimum and the default pool’s node_version. Manage other pools through their own configurations.

Before

hcl
resource "google_container_cluster" "example" {
  name               = "marcellus-wallace"
  location           = "us-central1-a"
  initial_node_count = 3
  min_master_version = "1.24"
}

After

hcl
resource "google_container_cluster" "example" {
  name               = "marcellus-wallace"
  location           = "us-central1-a"
  initial_node_count = 3
  min_master_version = var.gke_version
  node_version       = var.gke_version
}

References