Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 0 additions & 113 deletions modules/nodes-nodes-resources-configuring-auto.adoc

This file was deleted.

51 changes: 42 additions & 9 deletions modules/nodes-nodes-resources-configuring-setting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
[id="nodes-nodes-resources-configuring-setting_{context}"]
= Manually allocating resources for nodes

{product-title} supports the CPU and memory resource types for allocation. The `ephemeral-resource` resource type is also supported. For the `cpu` type, you specify the resource quantity in units of cores, such as `200m`, `0.5`, or `1`. For `memory` and `ephemeral-storage`, you specify the resource quantity in units of bytes, such as `200Ki`, `50Mi`, or `5Gi`. By default, the `system-reserved` CPU is `500m` and `system-reserved` memory is `1Gi`.
[role="_abstract"]
As an administrator, you can manually set `system-reserved` CPU and memory resources for your nodes. Setting these values ensures that your cluster is running efficiently and prevents node failure due to resource starvation of system components.

As an administrator, you can set these values by using a kubelet config custom resource (CR) through a set of `<resource_type>=<resource_quantity>` pairs
(e.g., `cpu=200m,memory=512Mi`).
By default, {product-title} uses a script on each node to 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. {product-title} supports the CPU and memory resource types for allocation.

However, you can manually set these values by using a `KubeletConfig` custom resource (CR) through a set of `<resource_type>=<resource_quantity>` pairs (e.g., `cpu=200m,memory=512Mi`). For the `cpu` type, you specify the resource quantity in units of cores, such as `200m`, `0.5`, or `1`. For `memory` and `ephemeral-storage`, you specify the resource quantity in units of bytes, such as `200Ki`, `50Mi`, or `5Gi`. By default, the `system-reserved` CPU is `500m` and `system-reserved` memory is `1Gi`. Also, use the `autoSizingReserved: false` parameter to override the default {product-title} behavior of automatically setting the `systemReserved` values.

[IMPORTANT]
====
You must use a kubelet config CR to manually set resource values. You cannot use a machine config CR.
You must use a `KubeletConfig` CR to manually set resource values. You cannot use a machine config CR.
====

For details on the recommended `system-reserved` values, refer to the link:https://access.redhat.com/solutions/5843241[recommended system-reserved values].
Expand Down Expand Up @@ -70,22 +72,53 @@ kind: KubeletConfig
metadata:
name: set-allocatable <1>
spec:
autoSizingReserved: false <2>
machineConfigPoolSelector:
matchLabels:
pools.operator.machineconfiguration.openshift.io/worker: "" <2>
pools.operator.machineconfiguration.openshift.io/worker: "" <3>
kubeletConfig:
systemReserved: <3>
systemReserved: <4>
cpu: 1000m
memory: 1Gi
memory: 4Gi
ephemeral-storage: 50Mi
#...
----
<1> Assign a name to CR.
<2> Specify the label from the machine config pool.
<3> Specify the resources to reserve for the node components and system components.
<2> Specify `false` to override the default {product-title} behavior of automatically setting the `systemReserved` values.
<3> Specify the label from the machine config pool.
<4> Specify the resources to reserve for the node components and system components.

. Run the following command to create the CR:
+
[source,terminal]
----
$ oc create -f <file_name>.yaml
----

.Verification

. Log in to a node you configured by entering the following command:
+
[source,terminal]
----
$ oc debug node/<node_name>
----

. Set `/host` as the root directory within the debug shell:
+
[source,terminal]
----
# chroot /host
----

. View the `/etc/node-sizing.env` file:
+
.Example output
[source,terminal]
----
SYSTEM_RESERVED_MEMORY=4Gi
SYSTEM_RESERVED_CPU=1000m
SYSTEM_RESERVED_ES=50Mi
----
+
The kubelet uses the `system-reserved` values in the `/etc/node-sizing.env` file.
4 changes: 1 addition & 3 deletions nodes/nodes/nodes-nodes-resources-configuring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include::_attributes/common-attributes.adoc[]

toc::[]

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.
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. By default, {product-title} automatically determines 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.

[IMPORTANT]
====
Expand All @@ -30,8 +30,6 @@ include::modules/sd-understanding-process-id-limits.adoc[leveloffset=+1]

include::modules/risks-setting-higher-process-id-limits.adoc[leveloffset=+2]

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

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

////
Expand Down