Search⌘ K
AI Features

Upgrading the Cluster

Understand how to upgrade your Kubernetes cluster on Google Kubernetes Engine using Terraform. Learn to modify environment variables, apply rolling upgrades to nodes, and ensure a smooth transition without downtime while maintaining resource stability.

Current Kubernetes version

Changing any aspect of the resources we created is easy and straightforward. All we have to do is modify Terraform definitions, and apply the changes. We can add resources, remove them, or change them in any way we want. To illustrate that, we’ll upgrade the Kubernetes version. But, before we do that, let’s see which version we’re running right now.

We use the following commands to do so.

Shell
kubectl version --output yaml

The output, limited to the relevant parts, is as follows.

Shell
...
serverVersion:
...
gitVersion: v1.24.6-gke.1500
...

We’re currently running Kubernetes version 1.24.6-gke.1500.

Note: Depending on what version you have installed, yours might be different.

Updating Kubernetes version environment variables

To upgrade the ...