This page shows you how to create a Google Kubernetes Engine (GKE) alpha cluster, which is a GKE cluster with Kubernetes alpha APIs and features enabled. With an alpha cluster, all alpha feature gates available with the Kubernetes version are enabled by default. Beta feature gates that Kubernetes enables by default are also enabled. You can modify from GKE defaults which feature gates are enabled. For more information about which feature gates are available with specific versions, and which beta features are enabled by default, see Feature gates for Alpha or Beta features in the Kubernetes documentation.
For more information about how GKE clusters work and how to choose which type of GKE cluster to create, see GKE cluster architecture and About cluster configuration choices.
Before you beginBefore you start, make sure that you have performed the following tasks:
gcloud components update
. Note: For existing gcloud CLI installations, make sure to set the compute/region
property. 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.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:
PROJECT_NUMBER-compute@developer.gserviceaccount.comReplace
PROJECT_NUMBER
with the project number that you copied.gcloud projects describe PROJECT_ID \ --format="value(projectNumber)"
Replace PROJECT_ID
with your project ID.
The output is similar to the following:
12345678901
roles/container.defaultNodeServiceAccount
role to the Compute Engine default service account:
gcloud projects add-iam-policy-binding PROJECT_ID \ --member="serviceAccount:PROJECT_NUMBER-compute@developer.gserviceaccount.com" \ --role="roles/container.defaultNodeServiceAccount"
Replace PROJECT_NUMBER
with the project number from the previous step.
You can create an alpha cluster by using the Google Cloud console or the gcloud CLI. To create a cluster which specifies the feature gates to enable or disable differently from the default values, use the gcloud CLI.
ConsoleIn the Google Cloud console, go to the Create a Kubernetes cluster page.
In the Cluster basics section, complete the following:
From the Release channel drop-down list, select No channel.
Note: It's not possible to create an alpha cluster enrolled in a release channel, because auto-upgrade cannot be disabled when using release channels, but alpha clusters cannot be upgraded.Optional: Specify a control plane version from the Version drop-down list.
Optional: Configure other settings for your new cluster.
Optional (available with GKE Enterprise): 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.
From the navigation pane, under Node Pools, click default-pool.
In the Node pool details section, complete the following:
From the navigation pane, under Node Pools, click Nodes.
From the Image type drop-down list, select the node image.
Choose the default Machine configuration to use for the instances. Each machine type is billed differently. The default machine type is e2-medium
. For machine type pricing information, refer to the machine type price sheet.
From the Boot disk type drop-down list, select the disk type.
Enter the Boot disk size.
Optional: From the navigation pane, under Node Pools, click Security.
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.
From the navigation pane, under Cluster, click Features.
Click Enable Kubernetes alpha features in this cluster.
Read and acknowledge the warning by selecting I understand the consequences.
Click Create.
Run the following command:
gcloud container clusters create CLUSTER_NAME \
--enable-kubernetes-alpha \
--no-enable-autorepair \
--no-enable-autoupgrade \
--location CONTROL_PLANE_LOCATION [\
--alpha-cluster-feature-gates FEATURE_GATES_LIST]
Replace the following:
CLUSTER_NAME
: the name you choose for the cluster.CONTROL_PLANE_LOCATION
: the Compute Engine location of the control plane of your cluster. Provide a region for regional clusters, or a zone for zonal clusters.--cluster-version VERSION
: (optional) specifies the GKE version to run in the cluster. If omitted, the cluster runs the default patch version for cluster creation for No channel, as shown in the Current versions table.FEATURE_GATES_LIST
: the list of feature gates to enable or disable differently from the default values. Each string represents the enablement or disablement of a feature gate. For example, featureX=true, featureY=false
. When you omit this flag, GKE creates the cluster using the default values for GKE, meaning all alpha feature gates available with the Kubernetes version are enabled. The beta feature gates enabled by default by Kubernetes are also enabled. For more information about which feature gates are available with specific versions, and which beta features are enabled by default, see Feature gates for Alpha or Beta features in the Kubernetes documentation. When you include this flag, you modify which feature gates are enabled from how the feature gates are set by default by GKE. For more information, see Feature gates and alpha clusters.
--alpha-cluster-feature-gates
flag, but list an invalid feature gate, including a feature gate that is unsupported for the specific Kubernetes version, the cluster might be created in an error state. For more information, see Troubleshoot creating an alpha cluster with feature gates.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:
--service-account=SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
Replace SERVICE_ACCOUNT_NAME with the name of your minimally-privileged service account.
You are prompted to acknowledge a warning that the alpha cluster is not upgraded and is deleted after 30 days:
This will create a cluster with Kubernetes alpha features enabled.
- This cluster will not be covered by the GKE SLA and should
not be used for production workloads.
- You will not be able to upgrade the master or nodes.
- The cluster will be deleted after 30 days.
Interact with a cluster using kubectl
After you create a cluster, you need to configure kubectl
before you can interact with the cluster from the command line.
With alpha clusters, you can selectively enable or disable feature gates. For more information, see Feature gates and alpha clusters.
To check the feature gate state for your cluster, see Check feature gate state.
Check when an alpha cluster expiresTo check when alpha clusters expire, run the following command:
gcloud container clusters list
Troubleshoot creating an alpha cluster with feature gates
If you attempt to create a cluster with an invalid feature gate, or a feature gate that's unsupported for the Kubernetes version of your cluster, the cluster can be created in an error state.
You can find a message similar to the following in Cloud Logging:
failed to set feature gates from initial flags-based config:
unrecognized feature gate: UNRECOGNIZED_FEATURE_GATE_NAME
If you encounter this error, delete the failed cluster. Check the spelling and compatibility of the feature gates with the given Kubernetes version. Then, try to create the cluster again.
What's nextRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4