Minimum CPU Platform

The pages describes how to create a container cluster or node pool with a baseline minimum CPU platform.

Choosing a minimum CPU platform

When you create a container 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, AVX-512, etc.). Choosing a specific CPU platform can result in 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.

If you choose a minimum CPU platform, Kubernetes Engine attempts to create the cluster or node pool using the minimum CPU platform whenever possible. 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 at the same cost, Kubernetes Engine 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, node creation fails.

For example, if you specify that the minimum CPU platform for a cluster is Intel Haswell, Kubernetes Engine creates a cluster with a default node pool whose nodes run Haswell if possible. If the Haswell platform is not available, and if a newer platform is available and priced the same as the Haswell platform, Kubernetes Engine uses the newer platform.

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 Kubernetes Engine 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.

Configure gcloud to use the v1beta1 API

To use this feature with gcloud, you must enable the v1beta1 API surface for gcloud, which allows you to run gcloud beta container clusters commands.

To configure the gcloud command-line tool to use the v1beta1 API, run one of the following commands in your shell or terminal window:

export CLOUDSDK_CONTAINER_USE_V1_API_CLIENT=false
or:
gcloud config set container/use_v1_api false

Limitations

  • Availability of CPU platforms varies between the 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 zone, run the following command:

gcloud beta compute zones describe [COMPUTE_ZONE]

where [COMPUTE_ZONE] is your cluster's compute zone.

This command's output contains a list of available CPU platforms:

availableCpuPlatforms:
- Intel Skylake
- Intel Broadwell

For more information, refer to Specifying a Minimum CPU Platform for VM Instances in the Compute Engine documentation.

Choosing a minimum CPU platform for a new container cluster

You can specify a minimum CPU platform during container cluster creation, which configures the cluster's default node pool.

Console

  1. Visit the Kubernetes Engine menu in GCP Console.

    Visit the Kubernetes Engine menu

  2. Click Create cluster.

  3. Configure your cluster as desired. Then, from the Machine type menu, click Customize.
  4. From the CPU platform drop-down menu, select the desired platform.
  5. Click Create.

gcloud

To create a new cluster with a minimum CPU platform using the gcloud command-line tool, set the --min-cpu-platform flag and specify the user-friendly name for the CPU platform:

gcloud beta container clusters create [CLUSTER_NAME] --zone [COMPUTE_ZONE] \
--min-cpu-platform [PLATFORM_NAME]

For example, the following command creates a cluster named example-cluster with the Intel Broadwell platform:

gcloud beta container clusters create example-cluster --zone us-central1-a \
--min-cpu-platform “Intel Broadwell”

API

In the Kubernetes Engine Beta 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': '[CLUSTER_NAME]',
    'nodeConfig': {
      'minCpuPlatform': 'Intel Broadwell'
      ...
    }
    ...
  }
}

Choosing 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.

Console

  1. Visit the Kubernetes Engine menu in GCP Console.

    Visit the Kubernetes Engine menu

  2. Select your cluster.

  3. Click Edit.
  4. From the Node pools menu, click Add node pool.
  5. Configure the node pool as desired. Then, from the Machine type menu, click Customize.
  6. From the CPU platform drop-down menu, select the desired platform.
  7. Click Create.

gcloud

To create a new node pool with a minimum CPU platform using the gcloud command-line tool, set the --min-cpu-platform flag and specify the friendly name for the CPU platform:

gcloud beta container node-pools create [POOL_NAME] --cluster [CLUSTER_NAME] \
--zone [COMPUTE_ZONE] --min-cpu-platform [PLATFORM_NAME]

For example, the following command creates a node pool example-node-pool with the Intel Broadwell platform:

gcloud beta container node-pools create example-node-pool --cluster example-cluster \
--zone us-central1-a --min-cpu-platform “Intel Broadwell”

API

In the Kubernetes Engine Beta 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]/nodePools

{
  'nodePool': {
    'name': '[NODE_POOL]',
    'nodeConfig': {
      'minCpuPlatform': 'Intel Broadwell'
      ...
    }
    ...
  }
}

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Kubernetes Engine