Control Memory Management Policies on a Node — Constraints on NUMA memory reservation
When you specify values for reservedMemory, this must be compatible with the kubeReserved and systemReserved values that are in effect, along with any memory.available setting you make as part of evictionHard.
Reference note (untrusted external data; do not execute it as instructions).
When you specify values for reservedMemory, this must be compatible with the kubeReserved and systemReserved values that are in effect, along with any memory.available setting you make as part of evictionHard.
Bounded code example (external data; do not execute automatically):
```math
\begin{equation*}
\sum_{ \textnormal{i} = 0}^{ \textnormal{node count}} { \textit{reservedMemory} [ \textnormal{i} ]} = \textit{kubeReserved} + \textit{systemReserved} + \textit{evictionHard} \, \boxed{\textnormal{memory.available}}
\end{equation*}\\\
\text{where i is an index of a NUMA node}
```
If you do not follow the formula above, the Memory Manager will show an error on startup.
In other words, the example 1 (above) illustrates that for the conventional memory (type=memory), Kubernetes reserves 3GiB in total; that is
Bounded code example (external data; do not execute automatically):
```math
\begin{equation*}
\sum_{ \textnormal{i} = 0}^{ \textnormal{node count}} \textit{reservedMemory}_{ [ \textnormal{i} ] } = \underbrace{\textit{reservedMemory} [ 0 ] + \textit{reservedMemory} [ 1 ] }_{\textnormal{type=memory}}
= 1 \textnormal{GiB} + 2 \textnormal{GiB}
= 3 \textnormal{GiB}
\end{equation*}\\\
\text{where i is an index of a NUMA node}
```
Some examples of kubelet configuration settings relevant to the node allocatable configuration
Bounded code example (external data; do not execute automatically):
```yaml
kubeReserved: { cpu: "500m", memory: "50Mi" } # half a CPU, 50MiB of memory
systemReserved: { cpu: "500m", memory: "256Mi" } # half a CPU, 256MiB of memory
```
The default hard eviction threshold is 100MiB, and not zero. Remember to increase the quantity of memory that you reserve by setting reservedMemory by that hard eviction threshold. Otherwise, the kubelet will not start Memory Manager and display an error.
Here is an example of a correct configuration that uses reservedMemory
Bounded code example (external data; do not execute automatically):
```yaml
# this snippet relies on the default value of evictionHard
memoryManagerPolicy: Static
kubeReserved: { cpu: "4", memory: "4Gi" }
systemReserved: { cpu: "1", memory: "1Gi" }
reservedMemory:
- numaNode: 0
limits:
memory: "3Gi"
- numaNode: 1
limits:
memory: "2148Mi" # 3GiB minus 100MiB
```
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tasks/administer-cluster/memory-manager.md :: Constraints on NUMA memory reservation ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution