All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

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
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback