Specifying a Node Image

This page shows you how to specify a node image for your nodes in Google Kubernetes Engine. To learn about how node images work, refer to Node Images.

Before you begin

To prepare for this task, perform the following steps:

  • Ensure that you have enabled the Google Kubernetes Engine API.
  • Enable Google Kubernetes Engine API
  • Ensure that you have installed the Cloud SDK.
  • Set your default project ID:
    gcloud config set project [PROJECT_ID]
  • If you are working with zonal clusters, set your default compute zone:
    gcloud config set compute/zone [COMPUTE_ZONE]
  • If you are working with regional clusters, set your default compute region:
    gcloud config set compute/region [COMPUTE_REGION]
  • Update gcloud to the latest version:
    gcloud components update

Specifying a node image

You can select the node image you want to use when you create a new cluster, or you can change the node image for an existing cluster.

Creating a new cluster

gcloud

Container-Optimized OS is the default option for a cluster node image. You can specify the Ubuntu node image by including the --image-type option when you use the gcloud container clusters create command.

To create a new cluster with Container-Optimized OS as the node image:

gcloud container clusters create [CLUSTER_NAME]

where [CLUSTER_NAME] is the name you choose for the cluster.

To create a new cluster with Ubuntu as the node image:

gcloud container clusters create [CLUSTER_NAME] --image-type ubuntu

Console

  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. Then, from the Image type drop-down menu, select the desired node image.
  4. Click Create.

Upgrading an existing cluster

gcloud

You can upgrade an existing cluster to use the Container-Optimized OS or Ubuntu node images by using the gcloud container clusters upgrade command. You can upgrade all node pools in the cluster, or you can specify specific a node pool using --node-pool.

To upgrade an existing cluster to use the Container-Optimized OS node image:

gcloud container clusters upgrade --image-type cos [CLUSTER_NAME] \
    [--node-pool [POOL_NAME]]

To upgrade an existing cluster to use the Ubuntu node image:

gcloud container clusters upgrade --image-type ubuntu [CLUSTER_NAME] \
    [--node-pool [POOL_NAME]]

Console

  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 Node pools, select the desired node pool.
  4. From the Node image field, click Change.
  5. Select the desired node image.
  6. Click Change.
  7. Click Save to exit the cluster modification screen.

What's next

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

Send feedback about...

Kubernetes Engine