Managing workloads on multi-architecture clusters by using the Multiarch Tuning Operator
The Multiarch Tuning Operator optimizes workload management within multi-architecture clusters and in single-architecture clusters transitioning to multi-architecture environments.
Architecture-aware workload scheduling allows the scheduler to place pods onto nodes that match the architecture of the pod images.
By default, the scheduler does not consider the architecture of a pod’s container images when determining the placement of new pods onto nodes.
To enable architecture-aware workload scheduling, you must create the ClusterPodPlacementConfig object. When you create the ClusterPodPlacementConfig object, the Multiarch Tuning Operator deploys the necessary operands to support architecture-aware workload scheduling. You can also use the nodeAffinityScoring plugin in the ClusterPodPlacementConfig object to set cluster-wide scores for node architectures. If you enable the nodeAffinityScoring plugin, the scheduler first filters nodes with compatible architectures and then places the pod on the node with the highest score.
When a pod is created, the operands perform the following actions:
-
Add the
multiarch.openshift.io/scheduling-gatescheduling gate that prevents the scheduling of the pod. -
Compute a scheduling predicate that includes the supported architecture values for the
kubernetes.io/archlabel. -
Integrate the scheduling predicate as a
nodeAffinityrequirement in the pod specification. -
Remove the scheduling gate from the pod.
Important
Note the following operand behaviors:
-
If the
nodeSelectorfield is already configured with thekubernetes.io/archlabel for a workload, the operand does not update thenodeAffinityfield for that workload. -
If the
nodeSelectorfield is not configured with thekubernetes.io/archlabel for a workload, the operand updates thenodeAffinityfield for that workload. However, in thatnodeAffinityfield, the operand updates only the node selector terms that are not configured with thekubernetes.io/archlabel. -
If the
nodeNamefield is already set, the Multiarch Tuning Operator does not process the pod. -
If the pod is owned by a DaemonSet, the operand does not update the
nodeAffinityfield. -
If both
nodeSelectorornodeAffinityandpreferredAffinityfields are set for thekubernetes.io/archlabel, the operand does not update thenodeAffinityfield. -
If only
nodeSelectorornodeAffinityfield is set for thekubernetes.io/archlabel and thenodeAffinityScoringplugin is disabled, the operand does not update thenodeAffinityfield. -
If the
nodeAffinity.preferredDuringSchedulingIgnoredDuringExecutionfield already contains terms that score nodes based on thekubernetes.io/archlabel, the operand ignores the configuration in thenodeAffinityScoringplugin.
Installing the Multiarch Tuning Operator by using the CLI
You can install the Multiarch Tuning Operator by using the OpenShift CLI (oc).
-
You have installed
oc. -
You have logged in to
ocas a user withcluster-adminprivileges.
-
Create a new project named
openshift-multiarch-tuning-operatorby running the following command:$ oc create ns openshift-multiarch-tuning-operator -
Create an
OperatorGroupobject:-
Create a YAML file with the configuration for creating an
OperatorGroupobject.Example YAML configuration for creating anOperatorGroupobjectapiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: openshift-multiarch-tuning-operator namespace: openshift-multiarch-tuning-operator spec: {} -
Create the
OperatorGroupobject by running the following command:$ oc create -f <file_name>- Replace
<file_name>with the name of the YAML file that contains theOperatorGroupobject configuration.
- Replace
-
-
Create a
Subscriptionobject:-
Create a YAML file with the configuration for creating a
Subscriptionobject.Example YAML configuration for creating aSubscriptionobjectapiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: openshift-multiarch-tuning-operator namespace: openshift-multiarch-tuning-operator spec: channel: stable name: multiarch-tuning-operator source: redhat-operators sourceNamespace: openshift-marketplace installPlanApproval: Automatic startingCSV: multiarch-tuning-operator.<version> -
Create the
Subscriptionobject by running the following command:$ oc create -f <file_name>- Replace
<file_name>with the name of the YAML file that contains theSubscriptionobject configuration.
- Replace
-
Note
For more details about configuring the Subscription object and OperatorGroup object, see "Installing from the software catalog by using the CLI".
-
To verify that the Multiarch Tuning Operator is installed, run the following command:
$ oc get csv -n openshift-multiarch-tuning-operatorExample outputNAME DISPLAY VERSION REPLACES PHASE multiarch-tuning-operator.<version> Multiarch Tuning Operator <version> multiarch-tuning-operator.1.0.0 SucceededThe installation is successful if the Operator is in
Succeededphase. -
Optional: To verify that the
OperatorGroupobject is created, run the following command:$ oc get operatorgroup -n openshift-multiarch-tuning-operatorExample outputNAME AGE openshift-multiarch-tuning-operator-q8zbb 133m -
Optional: To verify that the
Subscriptionobject is created, run the following command:$ oc get subscription -n openshift-multiarch-tuning-operatorExample outputNAME PACKAGE SOURCE CHANNEL multiarch-tuning-operator multiarch-tuning-operator redhat-operators stable
Installing the Multiarch Tuning Operator by using the web console
You can install the Multiarch Tuning Operator by using the OpenShift Container Platform web console.
-
You have access to the cluster with
cluster-adminprivileges. -
You have access to the OpenShift Container Platform web console.
-
Log in to the OpenShift Container Platform web console.
-
Navigate to Ecosystem → Software Catalog.
-
Enter Multiarch Tuning Operator in the search field.
-
Click Multiarch Tuning Operator.
-
Select the Multiarch Tuning Operator version from the Version list.
-
Click Install
-
Set the following options on the Operator Installation page:
-
Set Update Channel to stable.
-
Set Installation Mode to All namespaces on the cluster.
-
Set Installed Namespace to Operator recommended Namespace or Select a Namespace.
The recommended Operator namespace is
openshift-multiarch-tuning-operator. If theopenshift-multiarch-tuning-operatornamespace does not exist, it is created during the operator installation.If you select Select a namespace, you must select a namespace for the Operator from the Select Project list.
-
Update approval as Automatic or Manual.
If you select Automatic updates, Operator Lifecycle Manager (OLM) automatically updates the running instance of the Multiarch Tuning Operator without any intervention.
If you select Manual updates, OLM creates an update request. As a cluster administrator, you must manually approve the update request to update the Multiarch Tuning Operator to a newer version.
-
-
Optional: Select the Enable Operator recommended cluster monitoring on this Namespace checkbox.
-
Click Install.
-
Navigate to Ecosystem → Installed Operators.
-
Verify that the Multiarch Tuning Operator is listed with the Status field as Succeeded in the
openshift-multiarch-tuning-operatornamespace.
Multiarch Tuning Operator pod labels and architecture support overview
After installing the Multiarch Tuning Operator, you can verify the multi-architecture support for workloads in your cluster. You can identify and manage pods based on their architecture compatibility by using the pod labels. These labels are automatically set on the newly created pods to provide insights into their architecture support.
The following table describes the labels that the Multiarch Tuning Operator adds when you create a pod:
| Label | Description |
|---|---|
|
The pod supports multiple architectures. |
|
The pod supports only a single architecture. |
|
The pod supports the |
|
The pod supports the |
|
The pod supports the |
|
The pod supports the |
|
The Operator has set the node affinity requirement for the architecture. |
|
The Operator did not set the node affinity requirement. For example, when the pod already has a node affinity for the architecture, the Multiarch Tuning Operator adds this label to the pod. |
|
The pod is gated. |
|
The pod gate has been removed. |
|
An error has occurred while building the node affinity requirements. |
|
The Operator has set the architecture preferences in the pod. |
|
The Operator did not set the architecture preferences in the pod because the user had already set them in the |
Creating the ClusterPodPlacementConfig object
After installing the Multiarch Tuning Operator, you must create a ClusterPodPlacementConfig object. This object instructs the operator to deploy its operand, which enables architecture-aware workload scheduling across your cluster.
The ClusterPodPlacementConfig object supports two optional plugins:
-
The node affinity scoring plugin patches pods to set soft preferences, using weighted affinities, for the architectures specified by the user. Pods are more likely to be scheduled on nodes running architectures with higher weights.
-
The exec format error monitor plugin detects
ENOEXECerrors, which occur when a pod attempts to execute a binary incompatible with the node’s architecture. When enabled, this plugin generates events in the affected pod’s event stream. It triggers aExecFormatErrorsDetectedPrometheus alert if one or moreENOEXECerrors are detected within the last six hours. These errors can result from incorrect architecture node selectors, invalid image metadata that affects architecture-aware workload scheduling, an incorrect binary in an image, or an incompatible binary injected at runtime.
Note
You can create only one instance of the ClusterPodPlacementConfig object.
ClusterPodPlacementConfig object configurationapiVersion: multiarch.openshift.io/v1beta1
kind: ClusterPodPlacementConfig
metadata:
name: cluster
spec:
logVerbosityLevel: Normal
namespaceSelector:
matchExpressions:
- key: multiarch.openshift.io/exclude-pod-placement
operator: DoesNotExist
plugins:
nodeAffinityScoring:
enabled: true
platforms:
- architecture: amd64
weight: 100
- architecture: arm64
weight: 50
execFormatErrorMonitor:
enabled: true
- You must set this field value to
cluster. - Optional: You can set the field value to
Normal,Debug,Trace, orTraceAll. The value is set toNormalby default. - Optional: You can configure the
namespaceSelectorto select the namespaces in which the Multiarch Tuning Operator’s pod placement operand must process thenodeAffinityof the pods. All namespaces are considered by default. - Optional: Includes a list of plugins for architecture-aware workload scheduling.
- Optional: You can use this plugin to set architecture preferences for pod placement. When enabled, the scheduler first filters out nodes that do not meet the pod’s requirements. Then, it prioritizes the remaining nodes based on the architecture scores defined in the
nodeAffinityScoring.platformsfield. - Optional: Set this field to
trueto enable thenodeAffinityScoringplugin. The default value isfalse. - Optional: Defines a list of architectures and their corresponding scores.
- Specify the node architecture to score. The scheduler prioritizes nodes for pod placement based on the architecture scores that you set and the scheduling requirements defined in the pod specification. Accepted values are
arm64,amd64,ppc64le, ors390x. - Assign a score to the architecture. The value for this field must be configured in the range of
1(lowest priority) to100(highest priority). The scheduler uses this score to prioritize nodes for pod placement, favoring nodes with architectures that have higher scores. - Optional: Set this field to
trueto enable theexecFormatErrorMonitorplugin. When enabled, the plugin detectsENOEXECerrors, caused when a pod executes a binary incompatible with the node’s architecture. The plugin generates events in the affected pods, and triggers theExecFormatErrorsDetectedPrometheus alert if one or more errors are found in the last six hours.
In this example, the operator field value is set to DoesNotExist. Therefore, if the key field value (multiarch.openshift.io/exclude-pod-placement) is set as a label in a namespace, the operand does not process the nodeAffinity of the pods in that namespace. Instead, the operand processes the nodeAffinity of the pods in namespaces that do not contain the label.
If you want the operand to process the nodeAffinity of the pods only in specific namespaces, you can configure the namespaceSelector as follows:
namespaceSelector:
matchExpressions:
- key: multiarch.openshift.io/include-pod-placement
operator: Exists
In this example, the operator field value is set to Exists. Therefore, the operand processes the nodeAffinity of the pods only in namespaces that contain the multiarch.openshift.io/include-pod-placement label.
Important
This Operator excludes pods in namespaces starting with kube-. It also excludes pods that are expected to be scheduled on control plane nodes.
Creating the ClusterPodPlacementConfig object by using the CLI
To deploy the pod placement operand that enables architecture-aware workload scheduling, you can create the ClusterPodPlacementConfig object by using the OpenShift CLI (oc).
-
You have installed
oc. -
You have logged in to
ocas a user withcluster-adminprivileges. -
You have installed the Multiarch Tuning Operator.
-
Create a
ClusterPodPlacementConfigobject YAML file:ExampleClusterPodPlacementConfigobject configurationapiVersion: multiarch.openshift.io/v1beta1 kind: ClusterPodPlacementConfig metadata: name: cluster spec: logVerbosityLevel: Normal namespaceSelector: matchExpressions: - key: multiarch.openshift.io/exclude-pod-placement operator: DoesNotExist plugins: nodeAffinityScoring: enabled: true platforms: - architecture: amd64 weight: 100 - architecture: arm64 weight: 50 -
Create the
ClusterPodPlacementConfigobject by running the following command:$ oc create -f <file_name>- Replace
<file_name>with the name of theClusterPodPlacementConfigobject YAML file.
- Replace
-
To check that the
ClusterPodPlacementConfigobject is created, run the following command:$ oc get clusterpodplacementconfigExample outputNAME AGE cluster 29s
Creating the ClusterPodPlacementConfig object by using the web console
To deploy the pod placement operand that enables architecture-aware workload scheduling, you can create the ClusterPodPlacementConfig object by using the OpenShift Container Platform web console.
-
You have access to the cluster with
cluster-adminprivileges. -
You have access to the OpenShift Container Platform web console.
-
You have installed the Multiarch Tuning Operator.
-
Log in to the OpenShift Container Platform web console.
-
Navigate to Ecosystem → Installed Operators.
-
On the Installed Operators page, click Multiarch Tuning Operator.
-
Click the Cluster Pod Placement Config tab.
-
Select either Form view or YAML view.
-
Configure the
ClusterPodPlacementConfigobject parameters. -
Click Create.
-
Optional: If you want to edit the
ClusterPodPlacementConfigobject, perform the following actions:-
Click the Cluster Pod Placement Config tab.
-
Select Edit ClusterPodPlacementConfig from the options menu.
-
Click YAML and edit the
ClusterPodPlacementConfigobject parameters. -
Click Save.
-
-
On the Cluster Pod Placement Config page, check that the
ClusterPodPlacementConfigobject is in theReadystate.
Deleting the ClusterPodPlacementConfig object by using the CLI
You can create only one instance of the ClusterPodPlacementConfig object. If you want to re-create this object, you must first delete the existing instance.
You can delete this object by using the OpenShift CLI (oc).
-
You have installed
oc. -
You have logged in to
ocas a user withcluster-adminprivileges.
-
Log in to the OpenShift CLI (
oc). -
Delete the
ClusterPodPlacementConfigobject by running the following command:$ oc delete clusterpodplacementconfig cluster
-
To check that the
ClusterPodPlacementConfigobject is deleted, run the following command:$ oc get clusterpodplacementconfigExample outputNo resources found
Deleting the ClusterPodPlacementConfig object by using the web console
You can create only one instance of the ClusterPodPlacementConfig object. If you want to re-create this object, you must first delete the existing instance.
You can delete this object by using the OpenShift Container Platform web console.
-
You have access to the cluster with
cluster-adminprivileges. -
You have access to the OpenShift Container Platform web console.
-
You have created the
ClusterPodPlacementConfigobject.
-
Log in to the OpenShift Container Platform web console.
-
Navigate to Ecosystem → Installed Operators.
-
On the Installed Operators page, click Multiarch Tuning Operator.
-
Click the Cluster Pod Placement Config tab.
-
Select Delete ClusterPodPlacementConfig from the options menu.
-
Click Delete.
-
On the Cluster Pod Placement Config page, check that the
ClusterPodPlacementConfigobject has been deleted.
Uninstalling the Multiarch Tuning Operator by using the CLI
You can uninstall the Multiarch Tuning Operator by using the OpenShift CLI (oc).
-
You have installed
oc. -
You have logged in to
ocas a user withcluster-adminprivileges. -
You deleted the
ClusterPodPlacementConfigobject.Important
You must delete the
ClusterPodPlacementConfigobject before uninstalling the Multiarch Tuning Operator. Uninstalling the Operator without deleting theClusterPodPlacementConfigobject can lead to unexpected behavior.
-
Get the
Subscriptionobject name for the Multiarch Tuning Operator by running the following command:$ oc get subscription.operators.coreos.com -n <namespace>- Replace
<namespace>with the name of the namespace where you want to uninstall the Multiarch Tuning Operator.Example outputNAME PACKAGE SOURCE CHANNEL openshift-multiarch-tuning-operator multiarch-tuning-operator redhat-operators stable
- Replace
-
Get the
currentCSVvalue for the Multiarch Tuning Operator by running the following command:$ oc get subscription.operators.coreos.com <subscription_name> -n <namespace> -o yaml | grep currentCSV- Replace
<subscription_name>with theSubscriptionobject name. For example:openshift-multiarch-tuning-operator. Replace<namespace>with the name of the namespace where you want to uninstall the Multiarch Tuning Operator.Example outputcurrentCSV: multiarch-tuning-operator.<version>
- Replace
-
Delete the
Subscriptionobject by running the following command:$ oc delete subscription.operators.coreos.com <subscription_name> -n <namespace>- Replace
<subscription_name>with theSubscriptionobject name. Replace<namespace>with the name of the namespace where you want to uninstall the Multiarch Tuning Operator.Example outputsubscription.operators.coreos.com "openshift-multiarch-tuning-operator" deleted
- Replace
-
Delete the CSV for the Multiarch Tuning Operator in the target namespace using the
currentCSVvalue by running the following command:$ oc delete clusterserviceversion <currentCSV_value> -n <namespace>- Replace
<currentCSV>with thecurrentCSVvalue for the Multiarch Tuning Operator. For example:multiarch-tuning-operator.<version>. Replace<namespace>with the name of the namespace where you want to uninstall the Multiarch Tuning Operator.Example outputclusterserviceversion.operators.coreos.com "multiarch-tuning-operator.<version>" deleted
- Replace
-
To verify that the Multiarch Tuning Operator is uninstalled, run the following command:
$ oc get csv -n <namespace>- Replace
<namespace>with the name of the namespace where you have uninstalled the Multiarch Tuning Operator.Example outputNo resources found in openshift-multiarch-tuning-operator namespace.
- Replace
Uninstalling the Multiarch Tuning Operator by using the web console
You can uninstall the Multiarch Tuning Operator by using the OpenShift Container Platform web console.
-
You have access to the cluster with
cluster-adminpermissions. -
You deleted the
ClusterPodPlacementConfigobject.Important
You must delete the
ClusterPodPlacementConfigobject before uninstalling the Multiarch Tuning Operator. Uninstalling the Operator without deleting theClusterPodPlacementConfigobject can lead to unexpected behavior.
-
Log in to the OpenShift Container Platform web console.
-
Navigate to Ecosystem → Software Catalog.
-
Enter Multiarch Tuning Operator in the search field.
-
Click Multiarch Tuning Operator.
-
Click the Details tab.
-
From the Actions menu, select Uninstall Operator.
-
When prompted, click Uninstall.
-
Navigate to Ecosystem → Installed Operators.
-
On the Installed Operators page, verify that the Multiarch Tuning Operator is not listed.