|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * microshift_configuring/microshift-workload-partitioning.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="microshift-enabling-workload-partitioning_{context}"] |
| 7 | += Enabling workload partitioning |
| 8 | + |
| 9 | +To enable workload partitioning on {microshift-short}, make the following configuration changes: |
| 10 | + |
| 11 | +* Update the {microshift-short} `config.yaml` file to include the kubelet configuration file. |
| 12 | +* Create the CRI-O systemd and configuration files. |
| 13 | +* Create and update the systemd configuration file for the {microshift-short} and CRI-O services respectively. |
| 14 | +
|
| 15 | +.Procedure |
| 16 | + |
| 17 | +. Update the {microshift-short} `config.yaml` file to include the kubelet configuration file to enable and configure CPU Manager for the workloads: |
| 18 | +* 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. |
| 19 | ++ |
| 20 | +.kubelet configuration example |
| 21 | +[source,yaml] |
| 22 | +---- |
| 23 | +# ... |
| 24 | +{ |
| 25 | + "management": { |
| 26 | + "cpuset": "0,6,7" <1> |
| 27 | + } |
| 28 | +} |
| 29 | +# ... |
| 30 | +---- |
| 31 | +<1> The `cpuset` applies to a machine with 8 VCPUs (4 cores) and is valid throughout the document. |
| 32 | +* Update the {microshift-short} config.yaml file in the path `/etc/microshift/config.yaml`. Embed the kubelet configuration in the {microshift-short} `config.yaml` file to enable and configure CPU Manager for the workloads. |
| 33 | ++ |
| 34 | +.{microshift-short} `config.yaml` example |
| 35 | +[source,yaml] |
| 36 | +---- |
| 37 | +# ... |
| 38 | +kubelet: |
| 39 | + reservedSystemCPUs: 0,6,7 <1> |
| 40 | + cpuManagerPolicy: static |
| 41 | + cpuManagerPolicyOptions: |
| 42 | + full-pcpus-only: "true" <2> |
| 43 | + cpuManagerReconcilePeriod: 5s |
| 44 | +# ... |
| 45 | +---- |
| 46 | +<1> Exclusive cpuset for the system daemons and the interrupts/timers. |
| 47 | +<2> kubelet configuration sets the `CPUManagerPolicyOptions` option to `full-pcpus-only` to ensure allocation of whole cores to the containers workload. |
| 48 | + |
| 49 | +. Create the CRI-O systemd and configuration files: |
| 50 | +* Create the CRI-O configuration file in the path `/etc/crio/crio.conf.d/20-microshift-workload-partition.conf` which overrides the default configuration that already exists in the `11-microshift-ovn.conf` file. |
| 51 | ++ |
| 52 | +.CRI-O configuration example |
| 53 | +[source,yaml] |
| 54 | +---- |
| 55 | +# ... |
| 56 | +[crio.runtime] |
| 57 | +infra_ctr_cpuset = "0,6,7" |
| 58 | + |
| 59 | +[crio.runtime.workloads.management] |
| 60 | +activation_annotation = "target.workload.openshift.io/management" |
| 61 | +annotation_prefix = "resources.workload.openshift.io" |
| 62 | +resources = { "cpushares" = 0, "cpuset" = "0,6,7" } |
| 63 | +# ... |
| 64 | +---- |
| 65 | +* Create the systemd file for CRI-O in the path `/etc/systemd/system/crio.service.d/microshift-cpuaffinity.conf`. |
| 66 | ++ |
| 67 | +.CRI-O systemd configuration example |
| 68 | +[source,yaml] |
| 69 | +---- |
| 70 | +# ... |
| 71 | +[Service] |
| 72 | +CPUAffinity=0,6,7 |
| 73 | +# ... |
| 74 | +---- |
| 75 | +
|
| 76 | +. Create and update the systemd configuration file with `CPUAffinity` value for the {microshift-short} and CRI-O services: |
| 77 | +* Create the {microshift-short} services systemd file in the path `/etc/systemd/system/microshift.service.d/microshift-cpuaffinity.conf`. {microshift-short} will be pinned using the systemd `CPUAffinity` value. |
| 78 | ++ |
| 79 | +.{microshift-short} services systemd configuration example |
| 80 | +[source,yaml] |
| 81 | +---- |
| 82 | +# ... |
| 83 | +[Service] |
| 84 | +CPUAffinity=0,6,7 |
| 85 | +# ... |
| 86 | +---- |
| 87 | +* Update the `CPUAffinity` value in the {microshift-short} ovs-vswitchd systemd file in the path `/etc/systemd/system/ovs-vswitchd.service.d/microshift-cpuaffinity.conf`. |
| 88 | ++ |
| 89 | +.{microshift-short} ovs-vswitchd systemd configuration example |
| 90 | +[source,yaml] |
| 91 | +---- |
| 92 | +# ... |
| 93 | +[Service] |
| 94 | +CPUAffinity=0,6,7 |
| 95 | +# ... |
| 96 | +---- |
| 97 | +* Update the `CPUAffinity` value in the {microshift-short} ovsdb-server systemd file in the path `/etc/systemd/system/ovsdb-server.service.d/microshift-cpuaffinity.conf` |
| 98 | ++ |
| 99 | +.{microshift-short} ovsdb-server systemd configuration example |
| 100 | +[source,yaml] |
| 101 | +---- |
| 102 | +# ... |
| 103 | +[Service] |
| 104 | +CPUAffinity=0,6,7 |
| 105 | +# ... |
| 106 | +---- |
0 commit comments