The maximum number of pods that can be created on a node is calculated based on the cluster type:
Network Model |
Calculation of the Maximum Number of Pods That Can Be Created on a Node |
Suggestions |
---|---|---|
Container tunnel network |
Depends on maximum number of pods on a node. |
None |
VPC network |
Depends on the smaller value between the maximum number of pods on a node and the number of container IP addresses that can be allocated on a node. |
To ensure proper functioning of new pods on a node, it is recommended that you limit maximum number of pods on the node to the number of container IP addresses that can be allocated on the node. If the number of container IP addresses on the node is insufficient, new pods may not run properly. |
Cloud Native 2.0 network (for CCE Turbo clusters) |
Depends on the smaller value between maximum number of pods on a node and the number of ENIs on a node in a CCE Turbo cluster. |
To ensure proper functioning of new pods on a node, it is recommended that you limit the maximum number of pods on the node to the number of ENIs available on it. If the available ENIs on the node are insufficient, new pods may not run properly. |
When creating a cluster using a VPC network, you need to configure the number of container IP addresses that can be allocated on each node (that is, the alpha.cce/fixPoolMask parameter) based on the allocation rules. For details about the VPC network's IP address allocation rules, see Container IP Address Management.
This parameter affects the maximum number of pods that can be created on a node. When container network is used, an IP address is allocated to every pod. If the container IP addresses pre-allocated on the node are insufficient, pods cannot be created. If pods use the host network (hostNetwork: true configured in the YAML file), the pods do not occupy the allocatable container IP addresses. For details, see Pod IP Address Allocation Differences Between the Container Network and Host Network.
By default, a node occupies three container IP addresses (network address, gateway address, and broadcast address). Therefore, the number of container IP addresses that can be allocated to a node equals the number of selected container IP addresses minus 3.
When creating a node, you can configure the maximum number of pods (maxPods) that can be created on the node. This parameter is a configuration item of kubelet and determines the maximum number of pods that can be created by kubelet.
For nodes in the default node pool (DefaultPool), the maximum number of pods cannot be changed after the nodes are created.
After a node in a custom node pool is created, you can modify the max-pods parameter in the node pool configuration to change the maximum number of pods on the node.
Table 1 lists the default maximum number of pods on a node based on node specifications.
In a CCE Turbo cluster, ECS nodes use sub-ENIs. The maximum number of pods that can be created on a node depends on the number of ENIs that can be used by the node.
When creating a pod, you can select the container network or host network for the pod.