Halaman ini menunjukkan cara menentukan image node untuk node di cluster mode Standar Google Kubernetes Engine (GKE). Untuk mempelajari cara kerja image node, dan jenis image node yang tersedia, baca Image node.
Node dalam cluster GKE Autopilot selalu menggunakan Container-Optimized OS dengan container (cos_containerd ). Anda tidak dapat menentukan image node yang berbeda dalam mode Autopilot.
Sebelum memulai
Sebelum memulai, pastikan Anda telah melakukan tugas berikut:
Jika ingin menggunakan Google Cloud CLI untuk tugas ini,
instal lalu
lakukan inisialisasi
gcloud CLI. Jika sebelumnya Anda telah menginstal gcloud CLI, dapatkan versi terbaru dengan menjalankan gcloud components update.
Menentukan image node
Anda dapat memilih image node yang ingin digunakan saat membuat cluster baru, atau Anda dapat mengubah image node untuk cluster yang sudah ada.
Membuat cluster baru
gcloud
Untuk membuat cluster baru dengan image node tertentu, jalankan perintah berikut:
Anda dapat mengupgrade cluster yang ada agar menggunakan image node tertentu dengan menggunakan
perintah gcloud container clusters upgrade. Anda dapat mengupgrade semua node pool dalam cluster, atau menentukan node pool tertentu menggunakan --node-pool.
Untuk mengupgrade cluster yang ada agar dapat menggunakan image node tertentu, jalankan perintah berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-01 UTC."],[],[],null,["# Specify a node image\n\n[Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page shows you how to specify a node image for nodes in\nGoogle Kubernetes Engine (GKE) Standard mode clusters. To learn about how node images work, and the types of node images that are\navailable, see [Node images](/kubernetes-engine/docs/concepts/node-images).\n\nNodes in GKE Autopilot clusters always use the\n[Container-Optimized OS with containerd](/kubernetes-engine/docs/concepts/using-containerd#about_containerd)\n(`cos_containerd`) node image. You can't specify a different node image in\nAutopilot mode.\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\nSpecifying a node image\n-----------------------\n\nYou can select the node image you want to use when you create a new cluster, or\nyou can change the node image for an existing cluster.\n| **Note:** Starting with GKE node version 1.19, the default node image for Linux nodes is the Container-Optimized OS with Containerd (`cos_containerd`) variant instead of the Container-Optimized OS with Docker (`cos`) variant.\n| **Warning:** In GKE version 1.24 and later, Docker-based node image types are not supported. In GKE version 1.23, you also cannot create new node pools with Docker node image types. You must migrate to a containerd node image type. To learn more about this change, see [About the Docker node image deprecation](/kubernetes-engine/docs/deprecations/docker-containerd).\n\n### Creating a new cluster\n\n### gcloud\n\nTo create a new cluster with a specific node image, run the following command: \n\n gcloud container clusters create \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e --image-type \u003cvar translate=\"no\"\u003eIMAGE_TYPE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name you choose for the cluster.\n- \u003cvar translate=\"no\"\u003eIMAGE_TYPE\u003c/var\u003e: the name of your [node image type](/kubernetes-engine/docs/concepts/node-images#available_node_images).\n\n### Console\n\n1.\n\n\n In the Google Cloud console, go to the **Create a Kubernetes cluster** page.\n\n [Go to Create a Kubernetes cluster](https://console.cloud.google.com/kubernetes/add)\n\n \u003cbr /\u003e\n\n2. Configure your cluster as desired.\n\n3. From the navigation pane, under **Node Pools** , click **Nodes**.\n\n4. In the **Image type** drop-down list, select the desired [node image](/kubernetes-engine/docs/concepts/node-images).\n\n5. Click **Create**.\n\n### Terraform\n\nTo create a new cluster with a specific node image using Terraform, refer\nto the following example: \n\n resource \"google_container_cluster\" \"default\" {\n name = \"gke-standard-zonal-node-image\"\n initial_node_count = 2\n\n node_config {\n image_type = \"cos_containerd\"\n }\n }\n\nTo learn more about using Terraform, see\n[Terraform support for GKE](/kubernetes-engine/docs/resources/use-terraform-gke).\n\n### Upgrading an existing cluster\n\n| **Warning:** In GKE version 1.24 and later, Docker-based node image types are not supported. In GKE version 1.23, you also cannot create new node pools with Docker node image types. You must migrate to a containerd node image type. To learn more about this change, see [About the Docker node image deprecation](/kubernetes-engine/docs/deprecations/docker-containerd).\n\nThis change requires recreating the nodes, which can cause disruption to your\nrunning workloads. For details about this specific change, find the\ncorresponding row in the [manual changes that recreate the nodes using a node\nupgrade strategy without respecting maintenance\npolicies](/kubernetes-engine/docs/concepts/managing-clusters#manual-changes-strategy-but-no-respect-policies)\ntable. To learn more about node updates, see [Planning for node update\ndisruptions](/kubernetes-engine/docs/concepts/managing-clusters#plan-node-disruption).\n| **Caution:** GKE immediately begins recreating the nodes for this change using the node upgrade strategy, regardless of active maintenance policies. GKE depends on [resource\n| availability](/kubernetes-engine/docs/how-to/node-upgrades-quota) for the change. Disabling node auto-upgrades [doesn't prevent this\nchange](/kubernetes-engine/docs/how-to/node-auto-upgrades#disable-only-versions). Ensure that your workloads running on the nodes are prepared for disruption before you initiate this change. \n\n### gcloud\n\nYou can upgrade an existing cluster to use a specific node image by using\nthe `gcloud container clusters upgrade` command. You can upgrade all node\npools in the cluster, or you can specify specific a node pool using\n`--node-pool`.\n\nTo upgrade an existing cluster to use a specific node image, run the\nfollowing command: \n\n gcloud container clusters upgrade \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e --image-type \u003cvar translate=\"no\"\u003eIMAGE_TYPE\u003c/var\u003e \\\n [--node-pool \u003cvar translate=\"no\"\u003ePOOL_NAME\u003c/var\u003e]\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your existing cluster.\n- \u003cvar translate=\"no\"\u003ePOOL_NAME\u003c/var\u003e: the name of the node pool you want to update.\n- \u003cvar translate=\"no\"\u003eIMAGE_TYPE\u003c/var\u003e: the name of your [node image type](/kubernetes-engine/docs/concepts/node-images#available_node_images).\n\n### Console\n\n1. Go to the **Google Kubernetes Engine** page in the Google Cloud console.\n\n [Go to Google Kubernetes Engine](https://console.cloud.google.com/kubernetes/list)\n2. In the cluster list, click the name of the cluster you want to modify.\n\n3. Click the **Nodes** tab.\n\n4. Under **Node Pools**, click the name of the node pool you want to upgrade.\n\n5. On the **Node pool details** page, click *edit* **Edit**.\n\n6. Under **Node version** , click **Change**.\n\n7. Select the desired [node version](/kubernetes-engine/versioning#versioning) and click **Change** to start the upgrade.\n\nWhat's next\n-----------\n\n- [Learn more about node images](/kubernetes-engine/docs/concepts/node-images).\n- [Learn more about node pools](/kubernetes-engine/docs/concepts/node-pools)."]]