Skip to content

Commit c2289c0

Browse files
committed
add --reserved-cpus kubelet command option
1 parent d58d1ae commit c2289c0

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,8 @@ Topics:
13351335
File: nodes-nodes-garbage-collection
13361336
- Name: Allocating resources for nodes
13371337
File: nodes-nodes-resources-configuring
1338+
- Name: Allocating specific CPUs for nodes in a cluster
1339+
File: nodes-nodes-resources-cpus
13381340
# - Name: Monitoring for problems in your nodes
13391341
# File: nodes-nodes-problem-detector
13401342
- Name: Machine Config Daemon metrics

modules/nodes-nodes-resources-configuring-about.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ If a flag is not set, the defaults are used. If none of the flags are set, the
2323
allocated resource is set to the node's capacity as it was before the
2424
introduction of allocatable resources.
2525

26+
[NOTE]
27+
====
28+
Any CPUs specifically reserved using the `reservedSystemCPUs` parameter are not available for allocation using `kube-reserved` or `system-reserved`.
29+
====
30+
2631
[id="computing-allocated-resources_{context}"]
2732
== How {product-title} computes allocated resources
2833

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes-nodes-resources-cpus
4+
5+
[id="nodes-nodes-resources-cpus-reserve_{context}"]
6+
= Reserving CPUs for nodes
7+
8+
To explicitly define a list of CPUs that are reserved for specific nodes, create a `KubeletConfig` custom resource (CR) to define the `reservedSystemCPUs` parameter. This list supersedes the CPUs that might be reserved using the `systemReserved` and `kubeReserved` parameters.
9+
10+
.Procedure
11+
12+
. Obtain the label associated with the machine config pool (MCP) for the type of node you want to configure:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc describe machineconfigpool <name>
17+
----
18+
+
19+
For example:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc describe machineconfigpool worker
24+
----
25+
+
26+
.Example output
27+
[source,yaml]
28+
----
29+
Name: worker
30+
Namespace:
31+
Labels: machineconfiguration.openshift.io/mco-built-in=
32+
pools.operator.machineconfiguration.openshift.io/worker= <1>
33+
Annotations: <none>
34+
API Version: machineconfiguration.openshift.io/v1
35+
Kind: MachineConfigPool
36+
...
37+
----
38+
<1> Get the MCP label.
39+
40+
. Create a YAML file for the `KubeletConfig` CR:
41+
+
42+
[source,yaml]
43+
----
44+
apiVersion: machineconfiguration.openshift.io/v1
45+
kind: KubeletConfig
46+
metadata:
47+
name: set-reserved-cpus <1>
48+
spec:
49+
kubeletConfig:
50+
reservedSystemCPUs: "0,1,2,3" <2>
51+
machineConfigPoolSelector:
52+
matchLabels:
53+
pools.operator.machineconfiguration.openshift.io/worker: "" <3>
54+
----
55+
<1> Specify a name for the CR.
56+
<2> Specify the core IDs of the CPUs you want to reserve for the nodes associated with the MCP.
57+
<3> Specify the label from the MCP.
58+
59+
. Create the CR object:
60+
+
61+
[source,terminal]
62+
----
63+
$ oc create -f <file_name>.yaml
64+
----
65+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:context: nodes-nodes-resources-cpus
2+
[id="nodes-nodes-resources-cpus"]
3+
= Allocating specific CPUs for nodes in a cluster
4+
include::modules/common-attributes.adoc[]
5+
6+
toc::[]
7+
8+
9+
When using the xref:../../scalability_and_performance/using-cpu-manager.adoc[static CPU Manager policy], you can reserve specific CPUs for use by specific nodes in your cluster. For example, on a system with 24 CPUs, you could reserve CPUs numbered 0 - 3 for the control plane allowing the compute nodes to use CPUs 4 - 23.
10+
11+
// The following include statements pull in the module files that comprise
12+
// the assembly. Include any combination of concept, procedure, or reference
13+
// modules required to cover the user story. You can also include other
14+
// assemblies.
15+
16+
include::modules/nodes-nodes-resources-cpus-reserve.adoc[leveloffset=+1]
17+
18+
.Additional resources
19+
20+
* For more information on the `systemReserved` and `kubeReserved` parameters, see xref:../../nodes/nodes/nodes-nodes-resources-configuring.html#nodes-nodes-resources-configuring-about_nodes-nodes-resources-configuring[Allocating resources for nodes in an {product-title} cluster].

0 commit comments

Comments
 (0)