Skip to content

Commit ce14d51

Browse files
committed
OSDOCS#13057: Cluster-wide architecture preferred/weighted affinity
1 parent e937dfd commit ce14d51

File tree

6 files changed

+41
-10
lines changed

6 files changed

+41
-10
lines changed

modules/multi-arch-creating-podplacment-config-using-cli.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ spec:
3030
namespaceSelector:
3131
matchExpressions:
3232
- key: multiarch.openshift.io/exclude-pod-placement
33-
operator: DoesNotExist
33+
operator: DoesNotExist
34+
plugins:
35+
nodeAffinityScoring:
36+
enabled: true
37+
platforms:
38+
- architecture: amd64
39+
weight: 100
40+
- architecture: arm64
41+
weight: 50
3442
----
3543

3644
. Create the `ClusterPodPlacementConfig` object by running the following command:

modules/multi-arch-creating-podplacment-config.adoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,25 @@ spec:
2525
namespaceSelector: <3>
2626
matchExpressions:
2727
- key: multiarch.openshift.io/exclude-pod-placement
28-
operator: DoesNotExist
28+
operator: DoesNotExist
29+
plugins: <4>
30+
nodeAffinityScoring: <5>
31+
enabled: true <6>
32+
platforms: <7>
33+
- architecture: amd64 <8>
34+
weight: 100 <9>
35+
- architecture: arm64
36+
weight: 50
2937
----
3038
<1> You must set this field value to `cluster`.
3139
<2> Optional: You can set the field value to `Normal`, `Debug`, `Trace`, or `TraceAll`. The value is set to `Normal` by default.
3240
<3> Optional: You can configure the `namespaceSelector` to select the namespaces in which the Multiarch Tuning Operator's pod placement operand must process the `nodeAffinity` of the pods. All namespaces are considered by default.
41+
<4> Optional: Includes a list of plugins for architecture-aware workload scheduling.
42+
<5> 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.platforms` field.
43+
<6> Optional: Set this field to `true` to enable the `nodeAffinityScoring` plugin. The default value is `false`.
44+
<7> Optional: Defines a list of architectures and their corresponding scores.
45+
<8> 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`, or `s390x`.
46+
<9> Assign a score to the architecture. The value for this field must be configured in the range of `1` (lowest priority) to `100` (highest priority). The scheduler uses this score to prioritize nodes for pod placement, favoring nodes with architectures that have higher scores.
3347

3448
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.
3549

modules/multi-arch-gather-info-about-workloads.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ The following table describes the labels that the Multiarch Tuning Operator adds
2727
|`multiarch.openshift.io/scheduling-gate: gated` |The pod is gated.
2828
|`multiarch.openshift.io/scheduling-gate: removed` |The pod gate has been removed.
2929
|`multiarch.openshift.io/inspection-error: ""` |An error has occurred while building the node affinity requirements.
30-
30+
|`multiarch.openshift.io/preferred-node-affinity: set` |The Operator has set the architecture preferences in the pod.
31+
|`multiarch.openshift.io/preferred-node-affinity: not-set` |The Operator did not set the architecture preferences in the pod because the user had already set them in the `preferredDuringSchedulingIgnoredDuringExecution` node affinity.
3132
|====

modules/multi-arch-installing-using-cli.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spec:
6363
source: redhat-operators
6464
sourceNamespace: openshift-marketplace
6565
installPlanApproval: Automatic
66-
startingCSV: multiarch-tuning-operator.v1.0.0
66+
startingCSV: multiarch-tuning-operator.<version>
6767
----
6868

6969
.. Create the `Subscription` object by running the following command:
@@ -91,8 +91,8 @@ $ oc get csv -n openshift-multiarch-tuning-operator
9191
.Example output
9292
[source,terminal]
9393
----
94-
NAME DISPLAY VERSION REPLACES PHASE
95-
multiarch-tuning-operator.v1.0.0 Multiarch Tuning Operator 1.0.0 multiarch-tuning-operator.v0.9.0 Succeeded
94+
NAME DISPLAY VERSION REPLACES PHASE
95+
multiarch-tuning-operator.<version> Multiarch Tuning Operator <version> multiarch-tuning-operator.1.0.0 Succeeded
9696
----
9797
+
9898
The installation is successful if the Operator is in `Succeeded` phase.

modules/multi-arch-uninstalling-using-cli.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ oc get subscription.operators.coreos.com <subscription_name> -n <namespace> -o
4747
.Example output
4848
[source,terminal]
4949
----
50-
currentCSV: multiarch-tuning-operator.v1.0.0
50+
currentCSV: multiarch-tuning-operator.<version>
5151
----
5252

5353
. Delete the `Subscription` object by running the following command:
@@ -70,12 +70,12 @@ subscription.operators.coreos.com "openshift-multiarch-tuning-operator" deleted
7070
----
7171
$ oc delete clusterserviceversion <currentCSV_value> -n <namespace> <1>
7272
----
73-
<1> Replace `<currentCSV>` with the `currentCSV` value for the Multiarch Tuning Operator. For example: `multiarch-tuning-operator.v1.0.0`. Replace `<namespace>` with the name of the namespace where you want to uninstall the Multiarch Tuning Operator.
73+
<1> Replace `<currentCSV>` with the `currentCSV` value 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.
7474
+
7575
.Example output
7676
[source,terminal]
7777
----
78-
clusterserviceversion.operators.coreos.com "multiarch-tuning-operator.v1.0.0" deleted
78+
clusterserviceversion.operators.coreos.com "multiarch-tuning-operator.<version>" deleted
7979
----
8080

8181
.Verification

post_installation_configuration/configuring-multi-arch-compute-machines/multiarch-tuning-operator.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Architecture-aware workload scheduling allows the scheduler to place pods onto n
1212

1313
By default, the scheduler does not consider the architecture of a pod's container images when determining the placement of new pods onto nodes.
1414

15-
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.
15+
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.
1616

1717
When a pod is created, the operands perform the following actions:
1818

@@ -30,6 +30,14 @@ Note the following operand behaviors:
3030
* If the `nodeSelector` field is not configured with the `kubernetes.io/arch` label for a workload, the operand updates the `nodeAffinity` field for that workload. However, in that `nodeAffinity` field, the operand updates only the node selector terms that are not configured with the `kubernetes.io/arch` label.
3131
3232
* If the `nodeName` field is already set, the Multiarch Tuning Operator does not process the pod.
33+
34+
* If the pod is owned by a DaemonSet, the operand does not update the the `nodeAffinity` field.
35+
36+
* If both `nodeSelector` or `nodeAffinity` and `preferredAffinity` fields are set for the `kubernetes.io/arch` label, the operand does not update the `nodeAffinity` field.
37+
38+
* If only `nodeSelector` or `nodeAffinity` field is set for the `kubernetes.io/arch` label and the `nodeAffinityScoring` plugin is disabled, the operand does not update the `nodeAffinity` field.
39+
40+
* If the `nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution` field already contains terms that score nodes based on the `kubernetes.io/arch` label, the operand ignores the configuration in the `nodeAffinityScoring` plugin.
3341
====
3442

3543
//Installing Multiarch Tuning Operator

0 commit comments

Comments
 (0)