This page shows you how to create a single-zone cluster with the default features enabled in Google Kubernetes Engine. To enable or configure a specific feature of GKE on the cluster, see the documentation for that feature. You can also read more about the types of clusters you can create.
After you create a cluster, you cannot change it from zonal to regional, or regional to zonal.
Before you begin
Before you start, make sure you have performed the following tasks:
- Ensure that you have enabled the Google Kubernetes Engine API. Enable Google Kubernetes Engine API
- Ensure that you have installed the Cloud SDK.
Set up default
gcloud settings using one of the following methods:
gcloud init, if you want to be walked through setting defaults.
gcloud config, to individually set your project ID, zone, and region.
Using gcloud init
gcloud initand follow the directions:
If you are using SSH on a remote server, use the
--console-onlyflag to prevent the command from launching a browser:
gcloud init --console-only
Follow the instructions to authorize
gcloudto use your Google Cloud account.
- Create a new configuration or select an existing one.
- Choose a Google Cloud project.
- Choose a default Compute Engine zone.
Using gcloud config
- 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]
gcloudto the latest version:
gcloud components update
Creating a single-zone cluster
You can create a single-zone cluster using
gcloud or the Google Cloud Console.
To create a cluster with the
gcloud command-line tool, use one of the
gcloud container clusters commands.
Replace the placeholder values, such as [CLUSTER_NAME], with appropriate values.
Using a release channel:
[CHANNEL] with the name of the release
channel, one of
rapid. Clusters enrolled in the
rapid channel are not supported for production workloads.
gcloud beta container clusters create [CLUSTER_NAME] \ --zone [COMPUTE_ZONE] \ --release-channel [CHANNEL]
Using the default version:
gcloud container clusters create [CLUSTER_NAME] \ --zone [COMPUTE_ZONE]
Using a specific version:
[VERSION] with a specific version.
gcloud container clusters create [CLUSTER_NAME] \ --zone [COMPUTE_ZONE] \ --cluster-version [VERSION]
For the full list of optional flags, refer to the
gcloud container clusters
To create a single-zone cluster using Cloud Console:
Visit the Google Kubernetes Engine menu in Cloud Console.
Click Create cluster.
Choose the Standard cluster template or choose an appropriate template for your workload.
Choose the version of the cluster by selecting one of the following:
- Choose the release channel the cluster is enrolled in. Your cluster and node pools will be auto-upgraded within that channel.
- Choose a specific GKE version. Auto-upgrade is enabled by default, and your cluster and its node pools will be auto-upgraded when its current version is selected for auto-upgrade.
- Choose the default version. Auto-upgrade is enabled by default, and your cluster and its node pools will be auto-upgraded when its current version is selected for auto-upgrade.
Using release channels is recommended. If you must specify a version, leaving auto-upgrade enabled is recommended.
Customize the template if necessary. The following fields are required:
- Name: The name you choose for the cluster. It must be unique within the project and the zone.
- Location type: Whether all the nodes in the cluster are in the same zone, or can be in any zone in a given region.
- Zone: Compute Engine compute zone in which to create the cluster, if the Location type is Zonal.
- Region: Compute Engine compute zone in which to create the cluster, if the Location type is Regional.
- node pool:
- Cluster size: The number of nodes to create in the cluster. You must have available resource quota for the nodes and their resources (such as firewall routes).
- Machine type: Compute Engine
machine type to use for the instances. Each machine type is billed
differently. The default machine type is
n1-standard-1. For machine type pricing information, refer to the machine type price sheet.
After you create a cluster, you need to
before you can interact with the cluster from the command line.