Auto-upgrading nodes

This page shows you how to configure node auto-upgrades in Google Kubernetes Engine.

Overview

Node auto-upgrades help you keep the nodes in your cluster up to date with the latest stable version of Kubernetes. Auto-Upgrades use the same update mechanism as manual node upgrades. For more information about upgrading, refer to Upgrading a Container Cluster.

Some benefits of using auto-upgrades:

  • Lower management overhead: You don't have to manually track and update to the latest version of Kubernetes.
  • Better security: Sometimes new binaries are released to fix a security issue. With auto-upgrades, GKE automatically ensures that security updates are applied and kept up to date.
  • Ease of use: Provides a simple way to keep your nodes up to date with the latest Kubernetes features.

Node pools with auto-upgrades enabled are automatically scheduled for upgrades when a new stable Kubernetes version becomes available. When the upgrade is performed, the node pool is upgraded to match the current cluster master version.

If you want to have more control over when upgrades to your nodes occur, you can schedule a maintenance window.

You can disable auto-upgrades on one or more node pools at any time. However, disabling this feature does not halt in-progress upgrades.

Node auto-upgrades is not available for Alpha Clusters or clusters running the Ubuntu node image.

Creating a cluster or node pool with node auto-upgrades

gcloud

To create a cluster with auto-upgrades enabled for the default node pool, specify the --enable-autoupgrade flag in thegcloud container clusters create command:

gcloud container clusters create [CLUSTER_NAME] --zone [COMPUTE_ZONE] \
    --enable-autoupgrade

To create a node pool with auto-upgrades:

gcloud container node-pools create [NODE_POOL] --cluster [CLUSTER_NAME] \
    --zone [COMPUTE_ZONE] --enable-autoupgrade

Console

To create a cluster with auto-upgrades enabled for the default node pool, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click Create cluster.

  3. Configure your cluster as desired.
  4. Click Advanced edit, then select Enable auto-upgrade.
  5. Click Save to exit the Advanced edit overlay.
  6. Click Create.

To create a node pool with auto-upgrades in an existing cluster:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. From the Node pools section, click Add node pool.
  4. Configure your node pool as desired.
  5. Click Advanced edit for the node pool. Select Enable auto-upgrade.
  6. Click Save to close the Advanced edit overlay.
  7. Click Save again to modify the cluster.

Enabling node auto-upgrades for an existing node pool

gcloud

To enable auto-upgrades for an existing node pool, run the following command:

gcloud container node-pools update [NODE_POOL] --cluster [CLUSTER_NAME] \
    --zone [COMPUTE_ZONE] --enable-autoupgrade

Console

To enable auto-upgrades for an existing node pool, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. In the Node pools section, click the Advanced edit button for the node pool you want to modify.
  4. Select Enable auto-upgrade.
  5. Click Save to exit the Advanced edit overlay.
  6. Click Save again to modify the cluster.

Disabling node auto-upgrades for an existing node pool

gcloud

To disable auto-upgrades for an existing node pool, run the following command:

gcloud container node-pools update  [NODE_POOL] --cluster [CLUSTER_NAME] \
    --zone [COMPUTE_ZONE] --no-enable-autoupgrade

Console

To disable auto-upgrades for an existing node pool, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. In the Node pools section, click the Advanced edit button for the node pool you want to modify.
  4. Deselect Enable auto-upgrade.
  5. Click Save to exit the Advanced edit overlay.
  6. Click Save again to modify the cluster.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Kubernetes Engine