Reserve resources in a cluster

Last updated:2021-05-11 10:41:31

Nodes of a cluster need to run the required Kubernetes and KCE components. Therefore, the capacity of resources on a node is different from that of allocatable resources on the node in a KCE cluster.

To ensure stability of nodes, KCE reserves some resources on the nodes based on the node specifications for Kubernetes components such as kubelet, kube-proxy, and docker.

The allocatable resources on a node are calculated based on the following formula:

Allocatable = Capacity - Reserved - Eviction threshold

Note
Allocatable: the resources that can be allocated to pods on the node.
Capacity: the total hardware resources of the node.
Reserved: the resources that are reserved for system components on the node.
Eviction threshold: the resource threshold for evicting pods on the node.

Memory reservation rules

  1. total_mem ≤ 4 GB: reserved_value = total_mem × 25%
  2. 4 GB < total_mem ≤ 8 GB: reserved_value = 4 GB × 25% + (total_mem - 4 GB) × 20%
  3. 8 GB < total_mem ≤ 16 GB: reserved_value = 4 GB × 25% + 4 GB × 20% + (total_mem - 8 GB) × 10%
  4. 16 GB < total_mem ≤ 128 GB: reserved_value = 4 GB × 25% + 4 GB × 20% + 8 GB × 10% + (total_mem - 16 GB) × 6%
  5. total_mem > 128 GB: reserved_value = 4 GB × 25% + 4 GB × 20% + 8 GB × 10% + 112 GB × 6% + (total_mem - 128 GB) × 2%

Note
total_mem is the total size of memory, and reserved_value is the reserved memory size.

KCE reserves an extra 100 MiB memory on each node for kubelet to evict pods.

Common resource reservation configurations

CPU

Total CPU resources (unit: core) 2 4 8 16 32
Reserved CPU resources (unit: core) 0.07 0.08 0.09 0.11 0.15

Memory

Total memory (unit: GiB) 4 8 16 32 64
Reserved memory (unit: MiB) 1,024 1,843 2,662 3,645 5,611

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

Insufficient
Outdated
Unclear or awkward
Redundant or clumsy
Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈