All Products
Search
Document Center

Container Service for Kubernetes:Work with Flannel

Last Updated:Sep 18, 2024

Flannel is a simple and stable open source Container Network Interface (CNI) plug-in. Flannel enables pods on different nodes to access a virtual private cloud (VPC) by using custom routes that are provided by the VPC. This topic describes how to use Flannel in a Container Service for Kubernetes(ACK) cluster.

Background information

The Flannel network plug-in ensures that the CIDR block of pods does not overlap with the CIDR block of the VPC. The CIDR block of pods is evenly divided and allocated to the nodes in the cluster. Each pod on a node is assigned an IP address that belongs to the CIDR block of the node. The number of IP addresses that can be assigned to pods depends on the mask of the CIDR block of pods.

image

Usage notes

  • The cloud controller manager (CCM) manages the default route table of the VPC in which a cluster that uses Flannel is deployed. We recommend that you do not modify the default route table unless necessary. For more information about the CCM, see CCM.

  • By default, a cluster that uses Flannel does not support multiple VPC route tables. If the VPC of the cluster has more than one route table, you can refer to Configure multiple route tables for a VPC and configure multiple route tables for the cluster. If you use the NAT Firewall, make sure that you add the system route table of the VPC to the list of route tables after you create the firewall. Otherwise, the scaling of cluster nodes may be affected.

  • If a route table contains conflicting routes, the CCM automatically deletes the routes.

Procedure

On the Create Cluster page, select Flannel for Network Plug-in. The following table describes the parameters. For more information, see Create an ACK managed cluster and Create an ACK dedicated cluster.

Parameter

Description

VPC

Select a VPC in which you want to deploy the cluster.

vSwitch

Select the vSwitches that are used by the nodes in the cluster.

Number of Pods per Node

The maximum number of pods that can be deployed on each node.

Pod CIDR Block

The CIDR block of pods in the cluster. For more information, see Correlation between the VPC CIDR block and Kubernetes cluster CIDR block.

Service CIDR

The CIDR block of Services in the cluster. For more information, see Correlation between the VPC CIDR block and Kubernetes cluster CIDR block.

VPC limits and quotas