Choosing a Minimum CPU Platform

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

  • 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 desired compute zone, run the following command:

gcloud compute zones describe [COMPUTE_ZONE]

For [COMPUTE_ZONE], specify your desired compute zone.

The command returns a list of zone's available platforms, for example:

availableCpuPlatforms:
- Intel Skylake
- Intel Broadwell

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

Pricing

There is no additional cost for this feature.

Creating a new cluster with a minimum CPU platform

You can create a cluster with a minimum CPU platform using the gcloud command-line tool, Google Cloud Platform Console, or the GKE API.

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 container clusters create [CLUSTER_NAME] --zone [COMPUTE_ZONE] \
--min-cpu-platform [PLATFORM_NAME]

where:

  • [CLUSTER_NAME] is the name you choose for the cluster.
  • [COMPUTE_ZONE[ is the cluster's compute zone.
  • [PLATFORM_NAME] is the desired CPU platform 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

  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.

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' ... } ... } }

where:

  • [PROJECT_ID] is your project ID
  • [COMPUTE_ZONE] is the desired compute zone
  • [CLUSTER_NAME[ is the name you choose for the cluster

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 using the gcloud command-line tool, GCP Console, or the GKE API.

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 container node-pools create [POOL_NAME] --cluster [CLUSTER_NAME] \
--zone [COMPUTE_ZONE] --min-cpu-platform [PLATFORM_NAME]

where:

  • [POOL_NAME] is the name you choose for the node pool
  • [CLUSTER_NAME] is the name of the cluster in which the node pool is created
  • [COMPUTE_ZONE[ is the cluster's compute zone
  • [PLATFORM_NAME] is the desired CPU platform to run in the node pool

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

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

Console

  1. Visit the Kubernetes Engine menu in GCP Console.

    Visit the Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. In the Node pools section, click Add node pool.
  4. Configure the node pool as desired. Then, from the Machine type menu, click Customize.
  5. From the CPU platform drop-down menu, select the desired platform.
  6. 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': '[NODE_POOL]', 'nodeConfig': { 'minCpuPlatform': 'Intel Broadwell' ... } ... } }

where:

  • [PROJECT_ID] is your GCP project ID
  • [COMPUTE_ZONE] is the desired compute zone
  • [CLUSTER_NAME[ is the name of the cluster

What's next

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

Send feedback about...

Kubernetes Engine