Enable workload partitioning
To enable workload partitioning on MicroShift, make the following configuration changes:
-
Update the MicroShift
config.yamlfile to include the kubelet configuration file. -
Create the CRI-O systemd and configuration files.
-
Create and update the systemd configuration file for the MicroShift and CRI-O services respectively.
-
Update the MicroShift
config.yamlfile to include the kubelet configuration file to enable and configure CPU Manager for the workloads:-
Create the kubelet configuration file in the path
/etc/kubernetes/openshift-workload-pinning. The kubelet configuration directs the kubelet to modify the node resources based on the capacity and allocatable CPUs.kubelet configuration example# ... { "management": { "cpuset": "0,6,7"} } # ...
The cpusetapplies to a machine with 8 VCPUs (4 cores) and is valid throughout the document. -
Update the MicroShift config.yaml file in the path
/etc/microshift/config.yaml. Embed the kubelet configuration in the MicroShiftconfig.yamlfile to enable and configure CPU Manager for the workloads.MicroShiftconfig.yamlexample# ... kubelet: reservedSystemCPUs: 0,6,7cpuManagerPolicy: static cpuManagerPolicyOptions: full-pcpus-only: "true"
cpuManagerReconcilePeriod: 5s # ...
Exclusive cpuset for the system daemons and the interrupts/timers. kubelet configuration sets the CPUManagerPolicyOptionsoption tofull-pcpus-onlyto ensure allocation of whole cores to the containers workload.
-
-
Create the CRI-O systemd and configuration files:
-
Create the CRI-O configuration file in the path
/etc/crio/crio.conf.d/20-microshift-workload-partition.confwhich overrides the default configuration that already exists in the11-microshift-ovn.conffile.CRI-O configuration example# ... [crio.runtime] infra_ctr_cpuset = "0,6,7" [crio.runtime.workloads.management] activation_annotation = "target.workload.openshift.io/management" annotation_prefix = "resources.workload.openshift.io" resources = { "cpushares" = 0, "cpuset" = "0,6,7" } # ... -
Create the systemd file for CRI-O in the path
/etc/systemd/system/crio.service.d/microshift-cpuaffinity.conf.CRI-O systemd configuration example# ... [Service] CPUAffinity=0,6,7 # ...
-
-
Create and update the systemd configuration file with
CPUAffinityvalue for the MicroShift and CRI-O services:-
Create the MicroShift services systemd file in the path
/etc/systemd/system/microshift.service.d/microshift-cpuaffinity.conf. MicroShift will be pinned using the systemdCPUAffinityvalue.MicroShift services systemd configuration example# ... [Service] CPUAffinity=0,6,7 # ... -
Update the
CPUAffinityvalue in the MicroShift ovs-vswitchd systemd file in the path/etc/systemd/system/ovs-vswitchd.service.d/microshift-cpuaffinity.conf.MicroShift ovs-vswitchd systemd configuration example# ... [Service] CPUAffinity=0,6,7 # ... -
Update the
CPUAffinityvalue in the MicroShift ovsdb-server systemd file in the path/etc/systemd/system/ovsdb-server.service.d/microshift-cpuaffinity.confMicroShift ovsdb-server systemd configuration example# ... [Service] CPUAffinity=0,6,7 # ...
-