All Products
Search
Document Center

Container Service for Kubernetes:Increase the maximum number of pods in a cluster

Last Updated:Jul 16, 2024

The maximum number of pods on a worker node varies based on the network plug-in and cannot be adjusted in most cases. In Terway mode, the maximum number of pods on a node depends on the number of elastic network interfaces (ENIs) provided by the Elastic Compute Service (ECS) instance. In Flannel mode, the maximum number of pods on a node depends on the cluster configurations that you specify when you create the cluster. The upper limit cannot be modified after the cluster is created. When the number of pods in your cluster reaches the upper limit, we recommend that you scale out the node pool in the cluster to increase the number of pods in the cluster.

Maximum number of pods

Terway

image

Maximum number of pods in the node network

The components that are used in different Terway modes are different. The maximum number of pods that you can configure, the pod network, and the data transmission method vary based on the components that are used. The following table describes the details.

Note

For more information, see Work with Terway.

Terway mode

Terway mode selected when you create the ACK cluster

Component

Feature

Maximum number of pods supported by the node network

Maximum number of pods supported by the pod network (including static IP addresses, vSwitches, and security groups)

Data transmission method

Shared ENI

By default, terway-eniip is installed.

terway-eniip

  • IP addresses from ENIs are assigned to pods. Multiple pods share the same ENI.

  • The density of pod deployment on a node is high.

(Number of ENIs provided by the ECS instance type - 1) × Number of private IP addresses provided by an ENI

(EniQuantity-1) × EniPrivateIpAddressQuantity

Note

The maximum number of pods supported by the node network is greater than 11.

0

  • veth

  • datapathv2

  • ipvlan

Shared ENI + Trunk ENI

Select Trunk ENI when you create the ACK cluster.

terway-eniip + terway-controlplane

  • The Trunk ENI feature is supported to allow ENI trunking.

  • You can configure static IP addresses, separate vSwitches, and separate security groups for pods that use trunk ENIs.

  • The density of pod deployment on a node is high and the configuration is flexible.

(Number of ENIs provided by the ECS instance type - 1) × Number of private IP addresses provided by an ENI

(EniQuantity-1) × EniPrivateIpAddressQuantity

Note

The maximum number of pods supported by the node network is greater than 11.

Maximum number of network interfaces supported by an ECS instance type - Number of ENIs provided by an ECS instance type

EniTotalQuantity-EniQuantity

  • veth

  • datapathv2

  • ipvlan

Exclusive ENI

Select Assign One ENI to Each Pod when you create the ACK cluster.

terway-eni + terway-controlplane

An ENI is assigned to each pod to ensure optimal network performance.

Number of ENIs provided by the ECS instance type - 1

EniQuantity-1

Note

The maximum number of pods supported by the node network is greater than 6.

Number of ENIs provided by the ECS instance type - 1

EniQuantity-1

Exclusive

Maximum number of pods in the host network

By default, the maximum number of pods in the host network is three and cannot be modified. If you modify the maximum number of pods in the host network, IP addresses may fail to be allocated to newly created pods.

Flannel

In Flannel mode, the maximum number of pods on a node depends on the cluster configurations that you specify when you create the cluster and cannot be modified after the cluster is created.

image

How to increase the maximum number of pods in a cluster

You can use the following methods to increase the maximum number of pods in a cluster when different network plug-ins are used. Note that the following methods may not increase the maximum number of pods on a node.

(Recommended) Scale out the node pool in the cluster

Supported network plug-ins: Terway and Flannel.

Description: Manually or automatically scale out the node pool in the cluster. For more information, see Scale a node pool and Node scaling.

Impact: This method has no negative impact on your workloads. If the cluster contains an excessively large number of nodes, the availability and performance of the cluster may be compromised. We recommend that you retain a proper number of nodes in the cluster. For more information, see Suggestions on using large ACK Pro clusters.

Upgrade the instance specifications of worker nodes to increase the maximum number of pods on a node

Supported network plug-ins: Terway.

Description: Upgrade the instance specifications of worker nodes to increase the maximum number of pods on a node. For more information, see Upgrade the configurations of a worker node. The pod upper limit of worker nodes does not linearly increase with the instance specifications of worker nodes. The maximum number of pods supported by a node depends on the number of ENIs provided by the ECS instance family.

Impact: You need to restart an ECS instance to make the specification upgrade take effect. This may lead to temporary service interruptions. Before you upgrade the instance specifications, assess the loads of your businesses and decide whether redundant nodes are required. Then, drain the node that you want to upgrade and then remove it from the cluster. Upgrade the instance specifications during off-peak hours and re-add the node to the cluster. For more information about instance specification upgrades, such as billing details, see Overview of instance configuration changes and Upgrade the configurations of a worker node. For more information about how to remove and add existing nodes, see Remove a node and Add existing ECS instances to an ACK cluster.

Recreate the cluster and reset the pod CIDR block

Supported network plug-ins: Flannel.

Description: Create a cluster and set the Number of Pods per Node parameter based on your business requirements. The value of the Number of Pods per Node parameter is the maximum number of pods supported by the node. For more information, see Work with Flannel.

Description: Redeploy your business.

FAQ

How do I check the maximum number of pods supported by the node network in Terway mode?

  • Method 1: When you create a node pool, you can view the maximum number of pods supported by an instance type in the node network by checking the Terway Mode (Supported Pods) column in the Instance Type section.

  • Method 2: Perform the following steps to calculate the maximum number of pods supported by an instance type in the node network:

    • Search the relevant documentation to obtain the number of ENIs provided by the instance type. For more information, see Overview of instance families.

    • Call an API operation in OpenAPI Explorer to query the details of the instance type. Specify the instance type of the node in the InstanceTypes parameter and click Initiate Call. The EniQuantity parameter that is returned by the system indicates the number of ENIs provided by the instance type. The EniPrivateIpAddressQuantity parameter indicates the number of private IP addresses provided by each ENI.

How do I check the maximum number of pods supported by a node?

To view the maximum number of pods supported by a node, perform the following steps:

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane, choose Nodes > Nodes.

  3. On the Nodes page, you can view the pod quota of a node, which equals the maximum number of pods supported by the node.97.png

Why is the pod upper limit reached immediately after I create a cluster?

Cluster components are deployed in pods. The pods consume node resources. Some components may require multiple pods. If you install a great number of components in the cluster, a large number of pods are created for the components. To resolve this issue, we recommend that you use the methods described in the How to increase the maximum number of pods in a cluster section.

Can I increase the maximum number of pods on a node by manually modifying the number of ENIs or the pod quota?

No. In Terway mode, the maximum number of pods on a node depends on the number of ENIs provided by the ECS instance. If you manually increase the pod upper limit of a node, you will fail to create new pods after the pod upper limit is reached because no IP address is available. As a result, an error is recorded in the results of cluster inspections and cluster upgrade prechecks.

To resolve this issue, we recommend that you remove the node and add the node to the cluster again. For more information, see Remove a node and Add existing ECS instances to an ACK cluster.

Why does the pod upper limit differ between two nodes with the same CPU and memory specifications?

The pod upper limit of worker nodes does not linearly increase with the instance specifications of worker nodes. In Terway mode, the maximum number of pods supported by a node depends on the number of ENIs provided by the instance family. In Flannel mode, the default maximum number of pods on a node is 256. The default value can be increased for specific cluster types.