template annotation
in the YAML file of a workload to explicitly specify the pod resource specifications. For more information, see Annotation Description.template annotation
is specified for a workload, the annotation configuration prevails and the Request and Limit parameters are not calculated.Total CPU and Memory Values | Pod Resource Selection Rules |
The total CPU and memory values are both 0. | The pod specifications are 1 core and 2 GiB. |
Either the total CPU value or total memory value is 0. | Match the minimum value based on the non-0 total value.For example, if the total CPU value is 0 cores, and the total memory value is 8 GiB, match the minimum CPU value in allowed specifications with 8 GiB memory. The selected pod specifications are 1 core and 8 GiB. |
Neither the total CPU value nor total memory value is 0. | Match resource specifications in Resource Specifications. First, select a higher specification (specification A) with a CPU value the same as or similar to the total CPU value. Then, select a higher specification with a memory value similar to the total memory value. If the total memory value is less than the minimum memory value in the memory range of specification A, select the minimum memory value in the memory range of specification A. If the total memory value is greater than the maximum memory value in the memory range of specification A, select a higher specification (specification B) with a memory value similar to the total memory value and change the total CPU value to that of specification B. If the total memory value is within the memory range of specification A, select the nearest larger dual-value. |
Either the total CPU value or memory value exceeds the maximum specification. | An error occurs, and resource matching fails. |
resources:limits:cpu: "1"memory: 2Girequests:cpu: "1"memory: 2Gi
## container1resources:limits:cpu: "4"memory: 4Girequests:cpu: "2"memory: 4Gi## container2resources:limits:cpu: "1"memory: 2Girequests:cpu: "1"memory: 2Gi
nvidia.com/gpu
parameter value as vGPUs, and the value must be an integer.Total CPU, Memory, and GPU Values | Pod Resource Matching Rules |
The total values must comply with specification requirements, for example, 1, 2, 4, and 8. | First select a higher specification (specification A) with a GPU value the same as or similar to the total GPU value. Then, calculate the CPU and memory values based on the CPU specification calculation methods for pods to obtain the CPU specification (specification B). If the CPU and memory values of specification A are greater than or equal to those of specification B, select the GPU value of specification A. If the CPU and memory values of specification A are less than those of specification B, select a higher GPU specification (specification C) with CPU and memory values similar to those of specification B. In this method, the allocated number of GPU cards are more than that needed, which should be avoided. To prevent waste, lower the CPU and memory request values. |
Any total value exceeds the maximum specifications. | An error occurs, and resource matching fails. |
## eks.tke.cloud.tencent.com/gpu-type: V100resources:limits:cpu: "8"memory: 32Ginvidia.com/gpu: "1"requests:cpu: "4"memory: 16Ginvidia.com/gpu: "1"
## eks.tke.cloud.tencent.com/gpu-type: V100## container1resources:limits:cpu: "8"memory: 32Ginvidia.com/gpu: "1"requests:cpu: "4"memory: 16Ginvidia.com/gpu: "1"## container2resources:limits:cpu: "32"memory: 128Ginvidia.com/gpu: "1"requests:cpu: "16"memory: 64Ginvidia.com/gpu: "1"
Was this page helpful?