Create the namespace-scoped PodPlacementConfig object
After creating the ClusterPodPlacementConfig object, you can configure pod placement at the namespace level by creating namespace-scoped PodPlacementConfig objects.
PodPlacementConfig objects modify the pod placement controller’s behavior at the namespace level, and take precedence over the ClusterPodPlacementConfig object.
-
You have created a
ClusterPodPlacementConfigobject.
-
Using a text editor, create a YAML file based on the following example and modify the example with your namespace values:
ExamplePodPlacementConfigobject configurationapiVersion: multiarch.openshift.io/v1beta1 kind: PodPlacementConfig metadata: name: my-namespace-config namespace: my-namespace spec: labelSelector: matchExpressions: - key: app operator: In values: - my-label-for-apps-performing-better-on-arm64 priority: 100 plugins: nodeAffinityScoring: enabled: true platforms: - architecture: amd64 weight: 25 - architecture: arm64 weight: 75where:
metadata-
Specifies the object name, and namespace name. This parameter is required.
spec.labelSelector-
Optionally specifies a label so that the
PodPlacementConfigonly applies to a subset of pods in the namespace. If you do not specify this parameter, thePodPlacementConfigapplies to all pods in the namespace. spec.priority-
Optionally specifies a priority in case multiple
PodPlacementConfigobjects exist in one namespace. Higher priorities take precedence. Valid values are 0-255, and the default value is 0. If you specify multiplePodPlacementConfigobjects in one namespace, they must have different priority values. spec.plugins.nodeAffinityScoring-
Specifies architecture preferences for pod placement. The controller prioritizes nodes based on the architecture scores, with higher weights taking precedence. If you enable this plugin by setting
spec.plugins.nodeAffinityScoring.enabledtotrue, you must specify at least one platform with an architecture and weight value. spec.plugins.nodeAffinityScoring.platforms[]-
Specifies one or more platform configurations, each with a required architecture and weight pair. This parameter is required if
spec.plugins.nodeAffinityScoringis present. Valid architecture values arearm64,amd64,ppc64le, ands390x. Valid weight values are 0-100. Each architecture can only be specified once.
-
Apply the configuration file by running the following command:
$ oc create -f <filename>Replace
<filename>with the name of thePodPlacementConfigconfiguration file.