CCE Best Practice-Container Network Mode Selection
The CCE currently provides VPC route and VPC-ENI network modes. The two modes have their own characteristics. You can select a suitable container network mode to adapt to the requirements of service development.
Note:
The
VPC routenetwork mode has been adjusted to access to allow list. To utilize this mode, please submit a ticket.
VPC route
The VPC route mode coordinates the high speed network of Baidu AI Cloud VPC. This can provide the clusters with a high-performance and stable container network experience, but supports few characteristics.
In the VPC route mode, pod and node in the cluster are within two network segments and are interconnected by the VPC route. One typical VPC route mode cluster network topology is as shown in the figure below:
To create a cluster of VPC network mode, please refer to[K8S Cluster CCE Network Description and Planning](CCE/Typical Practices/CCE Cluster Network Description and Planning.md)
For the practice of accessing the public network by the cluster of VPC network mode, please refer to [CCE - Practice of Accessing Public Network](CCE/Typical Practices/CCE - Public Network Access Practice.md)
VPC-ENI
VPC-ENI mode is an extended network mode supported by Cloud Container Engine (CCE), Baidu AI Cloud. Based on elastic network interface product of Baidu AI Cloud, it can assign IP address in VPC to pods in cluster. Baidu AI Cloud VPC function is used to enable routing and connectivity of container network. It can realize that the control surface and data surface of pod and node are completely at the same network level. In this mode, pod can reuse all product features of Baidu AI Cloud VPC.
In the VPC-ENImode, the IPs of pod and node in the cluster are within the same VPC. But due to the limits of the secondary IP addresses of elastic network interface, the count of pods which can be created on the single node is small. A typical VPC-ENI mode cluster network topology is as shown in the figure below:
To create a cluster of VPC-ENI mode and evaluate the cluster size, please refer to [Create VPC-ENI Mode Cluster](CCE/Operation guide/Network Management/Creating VPC-ENI Mode Cluster.md)
For the practice of accessing the public network by the cluster of VPC-ENI mode, please refer to [Practice of Accessing Public Network by the Cluster of VPC-ENI Mode](CCE/Typical Practices/VPC-ENI Mode Cluster Public Network Access Practice.md)
Comparison of two modes
Supported machine type:
| Mode | Master | Node |
|---|---|---|
| VPC route | BCC/BBC | BCC/BBC |
| VPC-ENI | BCC | BCC |
Supported machine type:
| Mode | VPC route | VPC-ENI |
|---|---|---|
| Count of pods of a single node | More | 14~determined by node specifications |
| Pod IP source | Pod CIDR during cluster creation | Real IP in the VPC |
| Relying on infrastructure | VPC instance route (cluster node size is small due to the limit of VPC route table quota) | Elastic network interface (maximum 8 of a single node) |
| Security group configuration | The same security group can only be configured for all containers | The same security group can only be configured for all containers |
| Additional functions | Container network segment supports independent subnets with fixed IPs for STS pods |
|
| Public network access mode | EIP/NAT gateway | EIP/NAT gateway |
