This page explains how to create a Google Kubernetes Engine (GKE) cluster in
Autopilot mode.
Autopilot is a GKE mode of operation that lets you focus
on your services and applications, while GKE manages your nodes and
infrastructure. When you deploy your workloads, GKE provisions,
configures, and manages the resources and hardware, including when you scale.
Before you begin
Before you start, make sure that you have performed the following tasks:
If you want to use the Google Cloud CLI for this task,
install and then
initialize the
gcloud CLI. If you previously installed the gcloud CLI, get the latest
version by running the gcloud components update command. Earlier gcloud CLI versions might not support running the commands in this document.
If you want to register your new cluster to a fleet, ensure that you have the required APIs and permissions.
Set up IAM service accounts for GKE
GKE uses IAM service accounts that are attached to your nodes to
run system tasks like logging and monitoring. At a minimum, these node service accounts
must have the
Kubernetes Engine Default Node Service Account
(roles/container.defaultNodeServiceAccount) role on your project. By default,
GKE uses the
Compute Engine default service account,
which is automatically created in your project, as the node service account.
To grant the roles/container.defaultNodeServiceAccount role to the
Compute Engine default service account, complete the following steps:
The minimum information that you need to specify when creating a new Autopilot cluster is a name, project (usually the current project), and region (usually the default region for command line tools). However, there are many more possible configuration settings, some of which can't be changed after cluster creation. Ensure that you understand which settings can't be changed after cluster creation, and that you choose the right setting when creating a cluster if you don't want to have to create it again.
We strongly recommend that you specify a minimally-privileged IAM service account
that your nodes can use instead of the Compute Engine default service account. To
learn how to create a minimally-privileged service account, see
Use a least privilege service account.
To specify a custom service account in the gcloud CLI, add the following flag to
your command:
Optional: If you want to register your new cluster to a fleet, go to the Fleet registration section, and follow the Google Cloud console instructions for Create and register a new cluster to complete your cluster registration.
Optionally, specify a custom IAM service account for your nodes:
In the Advanced settings page, expand the Security section.
In the Service account menu, select your preferred service account.
We strongly recommend that you specify a minimally-privileged IAM service account
that your nodes can use instead of the Compute Engine default service account. To
learn how to create a minimally-privileged service account, see
Use a least privilege service account.
Optionally, configure other settings such as maintenance windows and
advanced security features.
Click Create.
Terraform
To create an Autopilot cluster using Terraform, refer to the following example:
To create an Autopilot cluster that uses a custom IAM
service account, follow these steps:
Create an IAM service account and grant it the
roles/container.defaultNodeServiceAccount role on the project:
resource"google_service_account""default"{account_id="gke-node-service-account"display_name="GKE node service account"}data"google_project""project"{}resource"google_project_iam_member""default"{project=data.google_project.project.project_idrole="roles/container.defaultNodeServiceAccount"member="serviceAccount:${google_service_account.default.email}"}
Create an Autopilot cluster that uses the new service account:
Create an Autopilot cluster with a specific release channel and version
By default, GKE enrolls new Autopilot clusters in the
Regular
release channel,
with the default GKE version in the channel. You can change
the release channel when you create an Autopilot cluster using the
gcloud CLI, the Google Cloud console, or by using Terraform.
You can also set a specific GKE version when you create a cluster
using the gcloud CLI. Setting the cluster version is only useful if
you have a specific version requirement. To set the cluster version, specify the
--cluster-version flag in the
gcloud container clusters create-auto command.
The version that you specify must be an available GKE version.
The following instructions for setting the release channel and version are
optional. Unless you require a specific GKE version, we recommend
that you keep the default release channel setting.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-09 UTC."],[],[]]