Plan the Virtual Private Cloud (VPC), vSwitches, and Service CIDR block before creating an Alibaba Cloud Container Service (ACS) cluster. Proper planning ensures efficient use of IP address space and leaves room for future scaling.
Network architecture overview
An ACS cluster network has three layers:
-
VPC — the outermost network boundary. Contains all vSwitches and defines the overall IP address space.
-
vSwitches — zone-level subdivisions within the VPC. Pod IP addresses are drawn from pod vSwitches.
-
Service CIDR block — a separate IP range reserved for Kubernetes Services (ClusterIP type). Effective only within the cluster.
Must-knows before you plan
Keep the following constraints in mind. Violating any of them causes routing errors that are difficult to fix after cluster creation.
-
The vSwitch CIDR block must be a subset of the VPC CIDR block.
-
The Service CIDR block must not overlap with any vSwitch CIDR block.
-
In multi-cluster or hybrid cloud scenarios, no two cluster CIDR blocks may overlap with each other or with VPC CIDR blocks.
-
The Service CIDR block cannot be modified after the cluster is created.
-
Pod IP addresses in one cluster cannot reach Services (ClusterIP) in another cluster in the same VPC — only pod-to-pod traffic crosses cluster boundaries.
CIDR block reference
The following table summarizes address ranges, sizing limits, and key constraints for each network resource.
| Resource | Allowed ranges | Key constraints |
|---|---|---|
| VPC | Standard RFC private blocks: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, or their subsets. Custom blocks are also allowed, except 100.64.0.0/10, 224.0.0.0/4, 127.0.0.0/8, and 169.254.0.0/16. Subnet mask: /8 to /28. |
In multi-VPC or hybrid cloud scenarios, use subnet masks of /16 or shorter to leave room for multiple non-overlapping VPCs. |
| vSwitch | Must be a subset of the VPC CIDR block. | Must not overlap with the Service CIDR block. Default limit: 150 vSwitches per VPC (increase quota). |
| Service CIDR block | Any private range that does not overlap with VPC or vSwitch CIDR blocks. | Cannot be modified after cluster creation. The Service CIDR block of different clusters in the same VPC can overlap. |
| IPv6 | Assigned by VPC after IPv6 is enabled. | See Assign IPv6 addresses to pods. |
Network scale planning
Regions and zones
Number of VPCs
Number of vSwitches
Pod capacity planning
Multi-zone configuration example
The following example shows a two-zone cluster configuration with a /16 VPC.
| VPC CIDR block | vSwitch CIDR block | Service CIDR block | Max assignable pod IPs |
|---|---|---|---|
| 192.168.0.0/16 | Zone I: 192.168.0.0/19 | 172.21.0.0/20 | 8,192 |
| 192.168.0.0/16 | Zone J: 192.168.32.0/19 | 172.21.0.0/20 | 8,192 |
Each /19 vSwitch provides 8,192 IP addresses for pods. The two vSwitches use non-overlapping ranges within the same VPC. The Service CIDR block (172.21.0.0/20) is outside the VPC range and is shared across both zones.
Network communication design
What's next
-
If your cluster uses a secondary VPC CIDR block or expands to a new zone, configure SNAT rules on a NAT gateway for the new CIDR block and update security group rules.
-
For pod-level public IP access, see Mount an independent public EIP to a pod.
-
To enable Internet access for pods (e.g., for image pulling), see Enable Internet access for a cluster.
-
For account architecture and multi-team isolation, see Account planning and Security planning.
-
For disaster recovery architecture, see Disaster recovery planning.