Choose a minimum CPU platform

Stay organized with collections Save and categorize content based on your preferences.

This page shows you how to specify a minimum CPU platform for nodes in Google Kubernetes Engine (GKE) clusters.

Why choose a minimum CPU platform?

Specifying a minimum CPU platform is useful if you require specific CPU capabilities and specifications, such as a high base frequency or optimized power management functionality.

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

How to choose a platform

The following table shows you how to choose a minimum CPU platform based on how you use GKE:

Scope Description Supported cluster configuration
Workload-level (recommended)

Choose a minimum platform in your Pod specification. GKE schedules those Pods as follows:

  • Autopilot: GKE schedules Pods on nodes with the specified platform or later.
  • Standard: GKE only schedules Pods on nodes with the specified platform. For example, if an Intel Ice Lake node pool exists and new Pods request a minimum of Intel Cascade Lake, GKE creates a new node pool with Intel Cascade Lake, even though Intel Ice Lake is a more advanced platform.
  • Autopilot running GKE version 1.25 and later.
  • Standard with node auto-provisioning running GKE version 1.23 and later.

Node and cluster level Choose a minimum CPU platform when you create a new Standard mode cluster or node pool. This setting doesn't support node auto-provisioning. For instructions, skip to Choose a minimum CPU platform at the node pool level. New Standard cluster or node pool

Pricing

You can choose a minimum CPU platform at no additional cost.

Before you begin

Before you start, make sure you have performed the following tasks:

  • Enable the Google Kubernetes Engine API.
  • Enable Google Kubernetes Engine API
  • If you want to use the Google Cloud CLI for this task, install and then initialize the gcloud CLI.

Check CPU platform availability

The available CPU platforms varies based on the compute zone in which your nodes run. You should check which CPU platforms are available in a zone even if you use Autopilot clusters or regional Standard clusters.

To check the available platforms in a specific zone, run the following command:

gcloud compute zones describe COMPUTE_ZONE

Replace COMPUTE_ZONE with the name of a zone, such as us-central1-a. If you use a regional cluster type, specify the name of a zone in that region.

The output is similar to the following:

availableCpuPlatforms:
- Intel Ice Lake
- Intel Cascade Lake
- Intel Skylake
- Intel Broadwell
- Intel Haswell
- Intel Ivy Bridge
- Intel Sandy Bridge
- AMD Milan
- AMD Rome
- Ampere Altra
- Intel Sapphire Rapids

When you use these values to request a minimum CPU platform, replace spaces with underscores in the platform name. For example, AMD_Milan.

Choose a minimum CPU platform at the workload level

If you use GKE Autopilot clusters or GKE Standard clusters with node auto-provisioning, you can choose a minimum CPU platform in your Pod specification. When you deploy the workload, GKE schedules those Pods only on nodes that have the specified platform or newer. We recommend this method.

Autopilot

In Autopilot, request a minimum CPU platform and a compute class. The compute class must support the CPU platform. Autopilot supports selecting a minimum CPU platform for the Balanced compute class.

Save the following manifest as min-cpu.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: min-cpu-platform
  labels:
    app: min-cpu
spec:
  replicas: 3
  selector:
    matchLabels:
      app: min-cpu
  template:
    metadata:
      labels:
        app: min-cpu
    spec:
      nodeSelector:
        cloud.google.com/compute-class: "COMPUTE_CLASS"
        supported-cpu-platform.cloud.google.com/PLATFORM: true
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 250m

Replace the following:

  • PLATFORM: the name of the CPU platform, such as AMD_Milan. The platform name is case-sensitive and must be underscore-delimited.
  • COMPUTE_CLASS: the name of the compute class, which must be Balanced.

Standard

In Standard clusters with node auto-provisioning enabled, request a CPU platform alongside a Compute Engine machine family. The machine family must support the CPU platform. For a list of supported platforms for each machine family, refer to Compute Engine CPU platforms.

Save the following manifest as min-cpu.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: min-cpu-platform
  labels:
    app: min-cpu
spec:
  replicas: 3
  selector:
    matchLabels:
      app: min-cpu
  template:
    metadata:
      labels:
        app: min-cpu
    spec:
      nodeSelector:
        cloud.google.com/machine-family: MACHINE_FAMILY
        cloud.google.com/requested-min-cpu-platform: PLATFORM
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 250m

Replace the following:

  • PLATFORM: the name of the CPU platform, such as AMD_Milan. The platform name is case-sensitive and must be underscore-delimited.
  • MACHINE_FAMILY: the name of the machine family, such as n2d.

Deploy the workload:

kubectl apply -f min-cpu.yaml

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.

Choose a minimum CPU platform at the node pool level

For GKE Standard clusters without node auto-provisioning, you can specify a minimum CPU platform when you create a new cluster or a node pool. You should only use this approach if you can't use the workload-level setting. This setting doesn't affect node auto-provisioning.

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 name of the CPU platform:

gcloud container node-pools create POOL_NAME \
    --cluster CLUSTER_NAME \
    --region COMPUTE_REGION \
    --min-cpu-platform PLATFORM

Replace the following:

  • POOL_NAME: the name of your new node pool.
  • CLUSTER_NAME: the name of your cluster.
  • COMPUTE_REGION: the region for the cluster.
  • PLATFORM: the CPU platform that you want to run in the node pool, such as "Intel Broadwell".

Console

  1. Go to the Google Kubernetes Engine page in the Google Cloud console.

    Go to Google Kubernetes Engine

  2. In the cluster list, click the name of the cluster you want to modify.

  3. Click Add Node Pool.

  4. Configure the node pool as desired.

  5. From the navigation pane, click Nodes.

  6. Under Machine Configuration,

  7. In the Series drop-down list, select a machine type.

  8. In the Machine type drop-down list, select Custom.

  9. Select Cores and Memory as desired.

  10. Click CPU Platform and GPU.

  11. In the CPU Platform drop-down list, select the desired platform.

  12. Click Create.

API

Include the minCpuPlatform property as part of the nodeConfig field in the request body. The value for minCpuPlatform must be the name of the platform, such as Intel Haswell, Intel Broadwell, and Intel Sandy Bridge.

For example, the following request creates a new node pool running the Intel Broadwell platform:

POST https://container.googleapis.com/v1/projects/PROJECT_ID/regions/COMPUTE_REGION/clusters/CLUSTER_NAME/nodePools

{
  'nodePool': {
    'name': 'POOL_NAME',
    'nodeConfig': {
      'minCpuPlatform': 'Intel Broadwell'
      ...
    }
    ...
  }
}

Replace the following:

  • PROJECT_ID: your project ID.
  • COMPUTE_REGION: the region for the cluster.
  • CLUSTER_NAME: the name of your cluster.
  • POOL_NAME: the name of your new node pool.

If you specify the platform when you create a cluster, the minimum CPU platform setting applies to the default node pool in the new cluster.

Alternatives

GKE also lets you select minimum CPU platforms using the following methods:

Alternatives

Cluster level flag

--autoprovisioning-min-cpu-platform flag

Limitations

The following limitations apply to all methods of selecting a minimum CPU platform:

  • All the limitations of Compute Engine minimum CPU platforms apply.
  • Availability of specific CPU platforms varies by zone.
  • The E2 machine type don't support minimum CPU platforms. You must select a different machine type.
  • Autopilot clusters only support platform selection for the Balanced compute class, not the default or Scale-Out compute classes.
  • If your Autopilot workload requests more than 80 vCPUs, the minimum CPU platform must be Intel Ice Lake or later. If you specify a less advanced platform, your Pod might remain in the Pending state indefinitely.

The following limitation applies to the cluster or node pool minimum CPU platform setting:

If you select a minimum CPU platform that is less advanced than the default CPU platform in the zone, or if the selected platform is no longer available, GKE checks whether there's a newer platform at the same cost. If a newer platform exists at the same cost, GKE creates the nodes using the newer platform. If a newer platform doesn't exist at the same cost, cluster or node pool creation fails.

What's next