The pages shows you how to create a cluster or node pool with a baseline minimum CPU platform.
Overview
When you create a cluster or node pool, you can choose a baseline minimum CPU platform for its nodes.
Certain advanced compute-intensive workloads in graphics, gaming, and analytics industries can make use of the specific features available through different CPU platform feature sets, such as AVX-2 and AVX-512. Choosing a specific CPU platform can yield substantial boosts in execution time and performance. By specifying a minimum CPU platform, your workloads can realize these gains in a more predictable manner, and you can ensure that your nodes never use a CPU platform inappropriate for their workloads.
About choosing a minimum CPU platform
If you choose a minimum CPU platform, Google Kubernetes Engine (GKE) attempts to create the cluster or node pool using the minimum CPU platform whenever possible.
There are certain cases in which it's not possible. For example:
- If the minimum CPU platform is older than the zone's default platform, or if the CPU platform is no longer available and there is a newer CPU platform available at the same cost, GKE creates the cluster or node pool using the newer platform.
- If you specify a platform that isn't available and there is no equivalent that is newer or identically priced, cluster or node creation fails.
Nodes never use a platform that is older than the minimum CPU platform you specify, and the cost of the nodes does not change if GKE picks a newer platform.
Nodes retain the same platform through their lifecycle, unless the specified CPU platform is retired, in which case your nodes runs on a newer platform.
Limitations
Before choosing a minimum CPU platform, keep in mind the following limitations:
- Availability of CPU platforms varies between zones.
- Minimum CPU platform cannot be used with shared core machine types, such as
g1-small
.
Availability
To see which CPU platforms are available in your compute zone, run the following command:
gcloud compute zones describe COMPUTE_ZONE
Replace COMPUTE_ZONE
with your zone.
The command returns a list of zone's available platforms, for example:
availableCpuPlatforms:
- Intel Skylake
- Intel Broadwell
For more information, see Specifying a minimum CPU platform for VM instances.
Pricing
There is no additional cost for this feature.
Create a new cluster with a minimum CPU platform
You can create a cluster with a minimum CPU platform by using the gcloud CLI, Google Cloud console, or the GKE API.
gcloud
To create a new cluster with a minimum CPU platform using the
gcloud CLI, set the --min-cpu-platform
flag and specify the
user-friendly name for the CPU platform:
gcloud container clusters create CLUSTER_NAME \
--zone COMPUTE_ZONE \
--min-cpu-platform PLATFORM_NAME
Replace the following:
CLUSTER_NAME
: the name of your new cluster.COMPUTE_ZONE
: the zone for the cluster.PLATFORM_NAME
: the CPU platform that you want to run in the cluster.
For example, the following command creates a cluster named example-cluster
with the Intel Broadwell
platform:
gcloud container clusters create example-cluster --zone us-central1-a \
--min-cpu-platform "Intel Broadwell"
Console
Go to the Google Kubernetes Engine page in the Google Cloud console.
Click add_box Create.
Configure your cluster as desired.
From the navigation pane, under the node pool you want to modify, click Nodes.
In the Series drop-down list, select a machine type family.
In the Machine type drop-down list, select Custom.
Select Cores and Memory as desired.
Click expand_more CPU Platform and GPU.
In the CPU Platform drop-down list, select the desired platform.
Click Create.
API
Include the minCpuPlatform
property as part of the nodeConfig
field in
the request body. The value for minCpuPlatform
must be the
friendly name for the platform, such as Intel Haswell
,
Intel Broadwell
, and Intel Sandy Bridge
.
For example, the request body for creating a cluster that runs
Intel Broadwell
might look like the following.
POST https://container.googleapis.com/v1/projects/PROJECT_ID/zones/COMPUTE_ZONE/clusters
{
'cluster': {
'name': 'CLUSTER_NAME',
'nodeConfig': {
'minCpuPlatform': 'Intel Broadwell'
...
}
...
}
}
Replace the following:
PROJECT_ID
: your project ID.CLUSTER_NAME
: the name of your new cluster.COMPUTE_ZONE
: the zone for the cluster.
Choose a minimum CPU platform for a new node pool
You can specify a minimum CPU platform for a new node pool in an existing cluster using the Google Cloud CLI, Google Cloud console, or the GKE API.
gcloud
To create a new node pool with a minimum CPU platform using the gcloud CLI,
set the --min-cpu-platform
flag and specify the friendly name for the CPU
platform:
gcloud container node-pools create POOL_NAME \
--cluster CLUSTER_NAME \
--zone COMPUTE_ZONE \
--min-cpu-platform PLATFORM_NAME
Replace the following:
POOL_NAME
: the name of your new node pool.CLUSTER_NAME
: the name of your cluster.COMPUTE_ZONE
: the zone for the cluster.PLATFORM_NAME
: the CPU platform that you want to run in the node pool.
For example, the following command creates a node pool named
example-node-pool
with the Intel Broadwell
CPU platform:
gcloud container node-pools create example-node-pool --cluster example-cluster \
--zone us-central1-a --min-cpu-platform "Intel Broadwell"
Console
Go to the Google Kubernetes Engine page in Google Cloud console.
In the cluster list, click the name of the cluster you want to modify.
Click add_box Add Node Pool.
Configure the node pool as desired.
From the navigation pane, click Nodes.
Under Machine Configuration,
In the Series drop-down list, select a machine type family.
In the Machine type drop-down list, select Custom.
Select Cores and Memory as desired.
Click expand_more CPU Platform and GPU.
In the CPU Platform drop-down list, select the desired platform.
Click Create.
API
Include the minCpuPlatform
property as part of the nodeConfig
field in
the request body. The value for minCpuPlatform
must be the friendly name
for the platform, such as Intel Haswell
, Intel Broadwell
, and
Intel Sandy Bridge
.
For example, the request body for a cluster running Intel Broadwell
might look
like this:
POST https://container.googleapis.com/v1/projects/PROJECT_ID/zones/COMPUTE_ZONE/clusters/CLUSTER_NAME/nodePools
{
'nodePool': {
'name': 'POOL_NAME',
'nodeConfig': {
'minCpuPlatform': 'Intel Broadwell'
...
}
...
}
}
Replace the following:
PROJECT_ID
: your project ID.COMPUTE_ZONE
: the zone for the cluster.CLUSTER_NAME
: the name of your cluster.POOL_NAME
: the name of your new node pool.
What's next
- See a list of available CPU platforms.
- Learn more about Regions and zones.
- Learn more about nodes.