Container Service for Kubernetes (ACK) uses the Cloud Controller Manager (CCM) to add routes to the route table of the virtual private cloud (VPC) where your cluster is deployed. These routes enable network connectivity between pods in the cluster. By updating the cloud-config ConfigMap, you can configure multiple route tables for the VPC. This topic describes how to do this for both ACK managed clusters and ACK dedicated clusters.
Prerequisites
-
An ACK cluster that uses Flannel as its network plugin has been created, and the cloud-controller-manager component meets the following version requirements:
-
ACK managed clusters:
-
Kubernetes ≥ 1.18
-
cloud-controller-manager ≥ v2.4.0
-
-
ACK dedicated clusters:
-
cloud-controller-manager ≥ v1.9.3.105-gfd4e547-aliyun
-
Manually upgrade the cluster as needed. To check or update the component version, see Cloud Controller Manager.
-
-
The VPC where the cluster resides has multiple route tables.
NoteIf the VPC has only one route table, you do not need to configure multiple route tables.
Background information
When a VPC has multiple route tables, you can associate Elastic Compute Service (ECS) instances with different route tables. Earlier versions of the CCM support only one route table per VPC. To use multiple route tables, update the CCM to the latest version in the ACK console. For more information, see Manage components.
Obtain route table IDs
Before configuring multiple route tables, obtain the route table IDs from the VPC console.
-
Log on to the VPC console. In the left-side navigation pane, click Route Tables.
-
On the Route Tables page, set the search condition to VPC ID, enter the ID of the VPC where your cluster resides, and then click the search icon.

Configure multiple route tables for an ACK managed cluster
You can configure multiple route tables for an ACK managed cluster through the ACK console.
Log on to the Container Service Management Console . In the navigation pane on the left, click Clusters.
On the Clusters page, click the name of your cluster. In the navigation pane on the left, click Add-ons.
-
On the Add-ons page, find the CCM and click Configuration.

-
In the routeTableIDs field, enter the route table IDs you obtained and click OK.
You must include the ID of the system route table of the VPC. Separate multiple route table IDs with commas (,). Example: vtb-t4n788888****,vtb-t4n7k6u3m0n840799***.
Configure multiple route tables for an ACK dedicated cluster
You can configure multiple route tables for an ACK dedicated cluster through the ACK console or by using kubectl.
Method 1: Use kubectl
Before you begin, make sure that your kubectl client is connected to the ACK dedicated cluster. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
-
Run the following command to open the cloud-config ConfigMap for editing:
kubectl edit cm -n kube-system cloud-config -
Replace
${ROUTE_TABLES_IDS}with the IDs of the route tables in your VPC. Make sure you include the ID of the system route table. Separate multiple route table IDs with commas (,). Example:vtb-t4n788888****,vtb-t4n7k6u3m0n840799****.ImportantModify only the
${ROUTE_TABLES_IDS}value in the cloud-config ConfigMap."routeTableIDs": "${ROUTE_TABLES_IDS}" -
Restart the pod that runs the CCM by running the following command:
kubectl -n kube-system delete po -lapp=cloud-controller-managerAfter the pod restarts, the routes of the cluster nodes appear in the specified route tables.
Method 2: Use the ACK console
Log on to the Container Service Management Console . In the navigation pane on the left, click Clusters.
On the Clusters page, click the name of your cluster. In the navigation pane on the left, click .
-
Select the kube-system namespace. Find the cloud-config ConfigMap and click Edit YAML in the Actions column.
-
In the View in YAML panel, set routeTableIDs to the IDs of the route tables in your VPC. Make sure you include the ID of the system route table. Separate multiple route table IDs with commas (,). Example: vtb-t4n788888****,vtb-t4n7k6u3m0n840799****. Then, click OK.

In the left navigation pane of the cluster management page, choose .
-
Select the kube-system namespace. Find the cloud-controller-manager DaemonSet and click Batch Redeploy in the lower part of the page.
After the redeployment completes, the routes of the cluster nodes appear in the specified route tables.