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 platformThe 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:
Standard with node auto-provisioning running GKE version 1.23 and later.
You can choose a minimum CPU platform at no additional cost.
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.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
.
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.
AutopilotIn 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. For a list of available CPU platforms in each compute class, see When to use specific compute classes.
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
.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
.PLATFORM
field. For example, if there's an existing node pool with Intel Ice Lake processors and the Pod requests Intel Cascade Lake, GKE creates a new node pool with Intel Cascade Lake to place the Pods.
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.
Note: Pods that use the nodeSelector can only schedule on node pools that are created by node auto-provisioning. If you have a manually-created node pool with a CPU platform set, Pods with the workload-level setting won't schedule on those nodes. Choose a minimum CPU platform at the node pool levelFor 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.
gcloudTo 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 \
--location CONTROL_PLANE_LOCATION \
--min-cpu-platform PLATFORM
Replace the following:
POOL_NAME
: the name of your new node pool.CLUSTER_NAME
: the name of your 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.PLATFORM
: the CPU platform that you want to run in the node pool, such as "Intel Broadwell"
.Go to the Google Kubernetes Engine page in the 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 needed.
From the navigation pane, click Nodes.
Under Machine Configuration,
In the Series drop-down list, select a machine type.
In the Machine type drop-down list, select Custom.
Select Cores and Memory as needed.
Click expand_more CPU Platform and GPU.
In the CPU Platform drop-down list, select the minimum platform.
Click Create.
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.
AlternativesGKE also lets you select minimum CPU platforms using the following methods:
AlternativesCluster level flag
--autoprovisioning-min-cpu-platform
flag
The following limitations apply to all methods of selecting a minimum CPU platform:
Balanced
compute class, not the default or Scale-Out
compute classes.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 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