Skip to content

Commit cb7e840

Browse files
committed
OSDOCS-11180: creating workload partitioning section
1 parent b96bbc0 commit cb7e840

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ Topics:
390390
File: microshift-greenboot-checking-status
391391
- Name: Configuring audit logging policies
392392
File: microshift-audit-logs-config
393+
- Name: Workload partitioning
394+
File: microshift-workload-partitioning
393395
---
394396
Name: Networking
395397
Dir: microshift_networking
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-workload-partitioning"]
3+
= Workload partitioning
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: microshift-workload-partitioning
6+
7+
toc::[]
8+
9+
Workload partitioning divides the node CPU resources into distinct CPU sets. The primary objective is to limit the amount of CPU usage for all control plane components which reserves rest of the device CPU resources for workloads of the user.
10+
11+
Workload partitioning allocates reserved set of CPUs to {microshift-short} services, cluster management workloads, and infrastructure pods, ensuring that the remaining CPUs in the cluster deployment are untouched and available exclusively for non-platform workloads.
12+
13+
include::modules/microshift-enabling-workload-partitioning.adoc[leveloffset=+1]
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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

Comments
 (0)