TKE clusters occupy node resources to run add-ons (such as kubelet, kube-proxy, and runtime). Therefore, the total number of node resources and the number of allocable resources in a cluster may differ from each other. This document describes the policies and notes in terms of node resource reservation in TKE clusters so that you can set reasonable numbers of requested resources and limited resources for Pods when deploying an application.
Allocable = Capacity - Reserved - Eviction - Threshold
Node CPU | Reservation Rule | Description |
---|---|---|
1c <= CPU <= 4c | 0.1c is reserved. | - |
4c < CPU <= 64c | 0.1c is reserved for the 4c part, and 2.5% for the excessive part. | For example, if CPU = 32c, reserved resources = 0.1 + (32 - 4) * 2.5% = 0.8c. |
64c < CPU <= 128c | 0.1c is reserved for the 4c part, 2.5% for the 4c to 64c part, and 1.25% for the excessive part. | For example, if CPU = 96c, reserved resources = 0.1 + (64 - 4) * 2.5% + (96 - 64) * 1.25% = 2c. |
CPU > 128c | 0.1c is reserved for the 4c part, 2.5% for the 4c to 64c part, 1.25% for the 64c to 128c part, and 0.5% for the excessive part. | For example, if CPU = 196c, reserved resources = 0.1 + (64 - 4) * 2.5% + (128 - 64) * 1.25% + (196 - 128) * 0.5% = 2.74c. |
Node Memory | Reservation Rule | Description |
---|---|---|
1 GB <= Memory <= 4 GB | 25% is reserved. | For example, if memory = 2 GB, reserved resources = 2 * 25% = 512 MB. |
4 GB < Memory <= 8 GB | 25% is reserved for the 4 GB part, and 20% for the excessive part. | For example, if memory = 8 GB, reserved resources = 4 * 25% + (8 - 4) * 20% = 1,843 MB. |
8 GB < Memory <= 16 GB | 25% is reserved for the 4 GB part, 20% for the 4 GB to 8 GB part, and 10% for the excessive part. | For example, if memory = 12 GB, reserved resources = 4 * 25% + (8 - 4) * 20% + (12 - 8) * 10% = 2,252 MB. |
16 GB < Memory <= 128 GB | 25% is reserved for the 4 GB part, 20% for the 4 GB to 8 GB part, 10% for the 8 GB to 16 GB part, and 6% for the excessive part. | For example, if memory = 32 GB, reserved resources = 4 * 25% + (8 - 4) * 20% + (16 - 8) * 10% + (32 - 16) * 6% = 3,645 MB. |
Memory > 128 GB | 25% is reserved for the 4 GB part, 20% for the 4 GB to 8 GB part, 10% for the 8 GB to 16 GB part, 6% for the 16 GB to 128 GB part, and 2% for the excessive part. | For example, if memory = 320 GB, reserved resources = 4 * 25% + (8 - 4) * 20% + (16 - 8) * 10% + (128 - 16) * 6% + (320 - 128) * 2% = 13,475 MB. |
Note:You can use custom kubelet parameters to modify
kube-reserved
for node resource reservation. We recommend you reserve sufficient CPU and memory resources for add-ons to ensure node stability.
Run the following command (replace NODE_NAME
with the actual node name) to check the allocable node resources in a cluster. The output result contains Capacity
and Allocatable
fields, along with measurements of CPU, memory, and temporary storage.
kubectl describe node NODE_NAME | grep Allocatable -B 7 -A 6
Apakah halaman ini membantu?