Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-04-14 15:43:55
Pods in a serverless cluster are based on KCI. You can specify pod specifications in the following ways:
You can specify KCI pod specifications through annotations
. For more information, see Specifications.
You can specify the requests
and limits
values for containers by using a Kubernetes-native method so that KCE automatically calculates the KCI pod specifications.
Up to five containers can run in a single KCI pod, and you can configure each container separately. However, KCE will summarize the CPU and memory configurations of all containers to evaluate the KCI pod specifications. If the specifications go beyond the limits, KCE will automatically adjust the specifications. The KCI pod will be charged based on the adjusted specifications.
Notes:
- If CPU and memory configurations are specified in annotations, the configurations will take effect, and KCE will not adjust the KCI pod specifications.
- If
requests
andlimits
are not specified for the pod, the values are counted as 0.- If
requests
andlimits
are not specified for any container in the pod, the pod specifications are counted as two vCPUs and a memory capacity of 4 GiB.- The total counts of
requests
andlimits
must comply with the supported specifications. For more information, see Specifications. If the values are far beyond the supported specifications, excessive resources may be allocated after automatic adjustment by KCE, causing a waste of resources. Therefore, setrequests
andlimits
properly.
1. Calculate the total counts of vCPUs and memory capacity for all containers in the KCI pod.
The limits
(or requests
if limits
is not specified) values of all containers in the pod are counted.
2. Automatically adjust the specifications based on the total counts.
Total counts of vCPUs and memory capacity | Specifications adjustment |
---|---|
Both are 0. | The default KCI pod specifications are two vCPUs and a memory capacity of 4 GiB. |
Either is 0. | The minimum KCI pod specifications matching the item whose total count is not 0 are used.For example, the total count of vCPUs is 0, and that of memory capacity is 7.8 GiB. Because 7.8 GiB is not supported, it is escalated to 8 GiB. Based on the memory capacity of 8 GiB, the minimum number of vCPUs is 2. Therefore, the adjusted KCI pod specifications are two vCPUs and a memory capacity of 8 GiB. |
Neither is 0. | The supported KCI pod specifications matching the total counts are used. Specifications A matching (equal to or close to) the total count of vCPUs are determined first, and then specifications B matching (equal to or close to) the total count of memory capacity are determined.- If the total count of memory capacity is less than the minimum memory capacity in specifications A, the minimum memory capacity in specifications A is used.- If the total count of memory capacity is greater than the maximum memory capacity in specifications A, specifications B are used, and the total count of vCPUs is adjusted to the minimum number of vCPUs in specifications B.- If the total count of vCPUs or memory capacity exceeds the upper limit, an error occurs, and creating the KCI pod fails. |
Either exceeds the upper limit. | An error occurs, and creating the KCI pod fails. |
resources:
limits:
cpu: "1"
memory: "2Gi"
requests:
cpu: "0.5"
memory: "1Gi"
Based on the total count of limits
, the KCI pod specifications are one vCPU and a memory capacity of 2 GiB.
#container1
resources:
limits:
cpu: "1"
memory: "2Gi"
requests:
cpu: "0.5"
memory: "1Gi"
#container2
resources:
limits:
cpu: "2C"
memory: "4Gi"
requests:
cpu: "1C"
memory: "2Gi"
The total count of vCPUs is 3, and that of memory capacity is 6 GiB. The CPU specifications are matched first. Because the number of vCPUs cannot be set to 3, it is automatically escalated to 4.
When four vCPUs are used, the minimum memory capacity supported is 8 GiB, which is greater than the total count of memory capacity. Therefore, the memory capacity is escalated to 8 GiB. The KCI pod specifications after adjustment are four vCPUs and a memory capacity of 8 GiB.
Pure Mode