tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Specifying resource specifications

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-09-29 09:46:32
TKE Serverless Cluster specifies the maximum resources allocated to a pod using annotation specification or automatic Request and Limit calculation. You can select either method.

Specifying by Annotation

TKE Serverless Cluster can add template annotation in the YAML file of a workload to explicitly specify the pod resource specifications. For more information, see Annotation Description.

Automatically Calculating by Request and Limit

TKE Serverless Cluster can calculate the Request and Limit parameters set for a workload to determine the resources required for running pods. The calculation method varies depending on the pod resource type. For more information on how to automatically calculate specified resource specifications based on the Request and Limit parameters, see CPU specification calculation methods for pods and GPU specification calculation methods for pods.
Note:
If template annotation is specified for a workload, the annotation configuration prevails and the Request and Limit parameters are not calculated.
For more information about Request and Limit resource allocation, see the supported CPU and GPU specifications in Resource Specifications. If the set value varies greatly from the supported specifications, the allocation of a resource may exceed expectations, resulting in resource waste.
Regardless of how Request and Limit are set, the final calculation result will match with that in Resource Specifications, and resources allocated to a pod will not exceed the allowed specifications.
If Request and Limit are not set for a container in a pod, the Request and Limit values of the container are regarded as 0.
If Request and Limit are not set for all containers in a pod, the default pod specifications are 1 core and 2 GiB.
Initcontainer and Container are calculated based on the following methods, and the larger value is used.


CPU specifications calculation methods for pods

Step 1. Calculate the total CPU and memory value of a pod.

The total values are the total Request value of all containers in a pod and the maximum Limit value of containers in a pod, respectively.

Step 2. Match pod resource specifications based on the following table.

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.


Sample

You can better understand the CPU specification calculation methods for pods based on the following examples.
Example 1
Example 2
resources:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: "1"
memory: 2Gi
Result: The selected pod specification is 1 core and 2 GiB.
## container1
resources:
limits:
cpu: "4"
memory: 4Gi
requests:
cpu: "2"
memory: 4Gi
## container2
resources:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: "1"
memory: 2Gi
Note: Total CPU value: max((2+1),max(4,1)) = 4 cores Total memory value: max((4+2),max(4,2)) = 6 GiB
Result: TKE Serverless Cluster does not support pod specifications of 4 cores and 6 GiB, and 6 GiB is less than the minimum memory value in the specifications with 4 CPU cores. Therefore, adjust the minimum memory value in the specifications with 4 CPU cores. The selected pod specifications are 4 cores and 8 GiB.


GPU specification calculation methods for pods

Note:
Typically, GPUs have the same nvidia.com/gpu parameter value as vGPUs, and the value must be an integer.
vGPU can be regarded as an independent GPU type. For example, 1/4*V100 indicates that 1/4 the computing power of a V100 GPU card is virtualized to a complete card. During resource allocation, one GPU card is applied for, that is, nvidia.com/GPU is 1.

Step 1. Calculate the total GPU value of a pod.

The total GPU value is the total Request value of all containers in a pod.

Step 2. Match pod resource specifications based on the following table.

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.


Sample

You can better understand the GPU specification calculation methods for pods based on the following examples.
Example 1
Example 2
## eks.tke.cloud.tencent.com/gpu-type: V100
resources:
limits:
cpu: "8"
memory: 32Gi
nvidia.com/gpu: "1"
requests:
cpu: "4"
memory: 16Gi
nvidia.com/gpu: "1"
Note: Total GPU value: 1 Total CPU value: max(4,8) = 8 cores Total memory value: max(16,32) = 32 GiB
Result: 8 cores and 32 GiB are less than the CPU and memory values (8 cores and 40 GiB) of the V100 GPU specification (one card) in Resource Specifications. The ultimately selected pod specification is 8 cores, 40 GiB, and 1x V100.
## eks.tke.cloud.tencent.com/gpu-type: V100
## container1
resources:
limits:
cpu: "8"
memory: 32Gi
nvidia.com/gpu: "1"
requests:
cpu: "4"
memory: 16Gi
nvidia.com/gpu: "1"
## container2
resources:
limits:
cpu: "32"
memory: 128Gi
nvidia.com/gpu: "1"
requests:
cpu: "16"
memory: 64Gi
nvidia.com/gpu: "1"
Note: Total GPU value: 1+1 = 2 Total CPU value: max((4+16),max(8,32)) = 32 cores Total memory value: max((16+64),max(32,128)) = 128 GiB
Result: 32 cores and 128 GiB are greater than the CPU and memory values (18 cores and 80 GiB) of the V100 GPU specification (two cards) but less than the CPU and memory values (36 cores and 160 GiB) of the V100 GPU specification (four cards).
The ultimately selected pod specification is 36 cores, 160 GiB, and 4x V100, resulting in the waste of two GPU cards. Such a waste should be avoided.


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan