Skip to content

Commit e0718b5

Browse files
committed
edits
1 parent fd17825 commit e0718b5

4 files changed

+114
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CPU and memory resources reserved for node components in {product-title} are bas
1515
| This setting is not used with {product-title}. Add the CPU and memory resources that you planned to reserve to the `system-reserved` setting.
1616

1717
|`system-reserved`
18-
| This setting identifies the resources to reserve for the node components and system components. The default settings depend on the {product-title} and Machine Config Operator versions. Confirm the default `systemReserved` parameter on the `machine-config-operator` repository.
18+
| This setting identifies the resources to reserve for the node components and system components, such as CRI-O and Kubelet. The default settings depend on the {product-title} and Machine Config Operator versions. Confirm the default `systemReserved` parameter on the `machine-config-operator` repository.
1919
|===
2020

2121
If a flag is not set, the defaults are used. If none of the flags are set, the
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes-nodes-resources-configuring.adoc
4+
5+
[id="nodes-nodes-resources-configuring-auto_{context}"]
6+
= Automatically allocating resources for nodes
7+
8+
{product-title} can automatically determine the optimal `system-reserved` CPU and memory resources for nodes associated with a specific machine config pool and update the nodes with those values when the nodes start.
9+
10+
To automatically determine and allocate the `system-reserved` resources on nodes, create a `KubeletConfig` custom resource (CR) to set the `autoSizingReserved: true` parameter. A script on each node calculates the optimal values for the respective reserved resources based on the installed CPU and memory capacity on each node. The script takes into account that increased capacity requires a corresponding increase in the reserved resources.
11+
12+
Automatically determining the optimal `system-reserved` settings ensures that your cluster is running efficiently and prevents node failure due to resource starvation of system components, such as CRI-O and kubelet, without your needing to manually calculate and update the values.
13+
14+
This feature is disabled by default.
15+
16+
.Prerequisites
17+
18+
. Obtain the label associated with the static `MachineConfigPool` object for the type of node you want to configure.
19+
Perform one of the following steps:
20+
21+
.. View the machine config pool:
22+
+
23+
[source,terminal]
24+
----
25+
$ oc describe machineconfigpool <name>
26+
----
27+
+
28+
For example:
29+
+
30+
[source,terminal]
31+
----
32+
$ oc describe machineconfigpool worker
33+
----
34+
+
35+
.Example output
36+
[source,yaml]
37+
----
38+
Name: worker
39+
Namespace:
40+
Labels: machineconfiguration.openshift.io/mco-built-in=
41+
pools.operator.machineconfiguration.openshift.io/worker=
42+
Annotations: <none>
43+
API Version: machineconfiguration.openshift.io/v1
44+
Kind: MachineConfigPool
45+
Metadata:
46+
...
47+
creationTimestamp: 2019-02-08T14:52:39Z
48+
generation: 1
49+
labels:
50+
pools.operator.machineconfiguration.openshift.io/worker: "" <1>
51+
...
52+
----
53+
<1> If a label has been added it appears under `labels`.
54+
55+
.. If the label is not present, add a key/value pair:
56+
+
57+
[source,terminal]
58+
----
59+
$ oc label machineconfigpool worker custom-kubelet=small-pods
60+
----
61+
62+
.Procedure
63+
64+
. Create a custom resource (CR) for your configuration change:
65+
+
66+
.Sample configuration for a resource allocation CR
67+
[source,yaml]
68+
----
69+
apiVersion: machineconfiguration.openshift.io/v1
70+
kind: KubeletConfig
71+
metadata:
72+
name: dynamic-node <1>
73+
spec:
74+
autoSizingReserved: true <2>
75+
machineConfigPoolSelector:
76+
matchLabels:
77+
pools.operator.machineconfiguration.openshift.io/worker: "" <3>
78+
----
79+
<1> Assign a name to CR.
80+
<2> Add the `autoSizingReserved` parameter set to `true` to allow {product-title} to automatically determine and allocate the `system-reserved` resources on the nodes associated with the specified label. To disable automatic allocation on those nodes, set this parameter to `false`.
81+
<3> Specify the label from the machine config pool.
82+
+
83+
The previous example enables automatic resource allocation on all worker nodes. {product-title} drains the nodes, applies the kubelet config, and restarts the nodes.
84+
85+
. Verify the `system-reserved` value:
86+
87+
.. Log in to a node you configured:
88+
+
89+
[source,terminal]
90+
----
91+
$ oc debug node/<node_name>
92+
----
93+
94+
.. View details on the kubelet process:
95+
+
96+
[source,terminal]
97+
----
98+
# ps -ef | grep kubelet
99+
----
100+
+
101+
.Example output
102+
[source,terminal]
103+
----
104+
root 1613 1 11 06:49 ? 00:00:05 kubelet --config=/etc/kubernetes/kubelet.conf --bootstrap-kubeconfig=/etc/kubernetes/kubeconfig --kubeconfig=/var/lib/kubelet/kubeconfig --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --runtime-cgroups=/system.slice/crio.service --node-labels=node-role.kubernetes.io/worker,node.openshift.io/os_id=rhcos --node-ip= --minimum-container-ttl-duration=6m0s --volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec --cloud-provider=azure --cloud-config=/etc/kubernetes/cloud.conf --pod-infra-container-image=quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:7b8e2e2857d8ac3499c9eb4e449cc3296409f1da21aa21d0140134d611e65b84 --system-reserved=cpu=0.07,memory=2.5Gi --v=2
105+
----
106+
+
107+
In the previous example, the worker nodes are allocated `0.07` CPU and 2.5 Gi of memory. It can take several minutes for the optimal values to appear.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// * nodes/nodes-nodes-resources-configuring.adoc
44

55
[id="nodes-nodes-resources-configuring-setting_{context}"]
6-
= Configuring allocated resources for nodes
6+
= Manually allocating resources for nodes
77

88
{product-title} supports the CPU and memory resource types for allocation. The `ephemeral-resource` resource type is supported as well. For the `cpu` type, the resource quantity is specified in units of cores, such as `200m`, `0.5`, or `1`. For `memory` and `ephemeral-storage`, it is specified in units of bytes, such as `200Ki`, `50Mi`, or `5Gi`.
99

@@ -115,9 +115,10 @@ spec:
115115
matchLabels:
116116
custom-kubelet: small-pods <2>
117117
kubeletConfig:
118-
systemReserved:
118+
systemReserved: <3>
119119
cpu: 1000m
120120
memory: 1Gi
121121
----
122122
<1> Assign a name to CR.
123123
<2> Specify the label from the Machine Config Pool.
124+
<3> Specify the resources to reserve for the node components and system components.

nodes/nodes/nodes-nodes-resources-configuring.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include::modules/common-attributes.adoc[]
55

66
toc::[]
77

8-
To provide more reliable scheduling and minimize node resource overcommitment, reserve a portion of the CPU and memory resources for use by the underlying node components, such as `kubelet` and `kube-proxy`, and the remaining system components, such as `sshd` and `NetworkManager`. By specifying the resources to reserve, you provide the scheduler with more information about the remaining CPU and memory resources that a node has available for use by pods.
8+
To provide more reliable scheduling and minimize node resource overcommitment, reserve a portion of the CPU and memory resources for use by the underlying node components, such as `kubelet` and `kube-proxy`, and the remaining system components, such as `sshd` and `NetworkManager`. By specifying the resources to reserve, you provide the scheduler with more information about the remaining CPU and memory resources that a node has available for use by pods. You can allow {product-title} to xref:../../nodes/nodes/nodes-nodes-resources-configuring.adoc#nodes-nodes-resources-configuring-auto_nodes-nodes-resources-configuring[automatically determine the optimal `system-reserved` CPU and memory resources] for your nodes or you can xref:../../nodes/nodes/nodes-nodes-resources-configuring.adoc#nodes-nodes-resources-configuring-setting_nodes-nodes-resources-configuring[manually determine and set the best resources] for your nodes.
99

1010
// The following include statements pull in the module files that comprise
1111
// the assembly. Include any combination of concept, procedure, or reference
@@ -14,6 +14,8 @@ To provide more reliable scheduling and minimize node resource overcommitment, r
1414

1515
include::modules/nodes-nodes-resources-configuring-about.adoc[leveloffset=+1]
1616

17+
include::modules/nodes-nodes-resources-configuring-auto.adoc[leveloffset=+1]
18+
1719
include::modules/nodes-nodes-resources-configuring-setting.adoc[leveloffset=+1]
1820

1921
////

0 commit comments

Comments
 (0)