Creating an IPv4/IPv6 Dual-Stack Cluster in CCE¶
This section describes how to set up a VPC with IPv6 CIDR block and create a cluster and nodes with an IPv6 address in the VPC, so that the nodes can access the Internet.
Overview¶
IPv6 addresses are used to deal with the problem of IPv4 address exhaustion. If a worker node (such as an ECS) in the current cluster uses IPv4, the node can run in dual-stack mode after IPv6 is enabled. Specifically, the node has both IPv4 and IPv6 addresses, which can be used to access the intranet or public network.
Application Scenarios¶
If your application needs to provide Services for users who use IPv6 clients, you can use IPv6 EIPs or the IPv4 and IPv6 dual-stack function.
If your application needs to both provide Services for users who use IPv6 clients and analyze the access request data, you can use only the IPv4 and IPv6 dual-stack function.
If internal communication is required between your application systems or between your application system and another system (such as the database system), you can use only the IPv4 and IPv6 dual-stack function.
Constraints¶
Clusters that support IPv4/IPv6 dual stack:
Cluster Type
Cluster Network Model
Version
Remarks
CCE cluster
Container tunnel network
v1.15 or later
IPv4/IPv6 dual stack will be generally available for clusters of v1.23.
ELB dual stack is not supported.
Worker nodes and master nodes in Kubernetes clusters use IPv4 addresses to communicate with each other.
Only one IPv6 address can be bound to each NIC.
When IPv4/IPv6 dual stack is enabled for the cluster, DHCP unlimited lease cannot be enabled for the selected node subnet.
If a dual-stack cluster is used, do not change the load balancer protocol version on the ELB console.
Step 1: Create a VPC¶
Before creating your VPCs, determine how many VPCs, the number of subnets, and what IP address ranges you will need.
Note
The basic operations for IPv4 and IPv6 dual-stack networks are the same as those for IPv4 networks. Only some parameters are different.
Perform the following operations to create a VPC named vpc-ipv6 and its default subnet named subnet-ipv6.
Log in to the management console.
Click in the upper left corner of the management console and select a region and a project.
Choose Networking > Virtual Private Cloud.
Click Create VPC.
Set the VPC and subnet parameters.
When configuring a subnet, select Enable for IPv6 CIDR Block to automatically allocate an IPv6 CIDR block to the subnet. IPv6 cannot be disabled after the subnet is created. Currently, you are not allowed to specify a custom IPv6 CIDR block.
¶ Parameter
Description
Example Value
Region
Specifies the desired region. Regions are geographic areas that are physically isolated from each other. The networks inside different regions are not connected to each other, so resources cannot be shared across different regions. For lower network latency and faster access to your resources, select the region nearest you.
-
Name
VPC name.
vpc-ipv6
IPv4 CIDR Block
Specifies the Classless Inter-Domain Routing (CIDR) block of the VPC. The CIDR block of a subnet can be the same as the CIDR block for the VPC (for a single subnet in the VPC) or a subset (for multiple subnets in the VPC).
The following CIDR blocks are supported:
10.0.0.0/8-24
172.16.0.0/12-24
192.168.0.0/16-24
192.168.0.0/16
Tag (Advanced Settings)
Specifies the VPC tag, which consists of a key and value pair. You can add a maximum of ten tags for each VPC.
The tag key and value must meet the requirements listed in Table 3.
Tag key: vpc_key1
Key value: vpc-01
¶ Parameter
Description
Example Value
Name
Specifies the subnet name.
subnet-ipv6
IPv4 CIDR Block
Specifies the IPv4 CIDR block for the subnet. This value must be within the VPC CIDR range.
192.168.0.0/24
IPv6 CIDR Block
Select Enable for IPv6 CIDR Block. An IPv6 CIDR block will be automatically assigned to the subnet. IPv6 cannot be disabled after the subnet is created. Currently, you are not allowed to specify a custom IPv6 CIDR block.
N/A
Associated Route Table
Specifies the default route table to which the subnet will be associated. You can change the route table to a custom route table.
Default
Advanced Settings
Gateway
Specifies the gateway address of the subnet.
This IP address is used to communicate with other subnets.
192.168.0.1
DNS Server Address
By default, two DNS server addresses are configured. You can change them if necessary. When multiple IP addresses are available, separate them with a comma (,).
100.125.x.x
Tag
Specifies the subnet tag, which consists of a key and value pair. You can add a maximum of ten tags to each subnet.
The tag key and value must meet the requirements listed in Table 4.
Tag key: subnet_key1
Key value: subnet-01
¶ Parameter
Requirement
Example Value
Tag key
Cannot be left blank.
Must be unique in a VPC.
Can contain a maximum of 36 characters.
Can contain letters, digits, underscores (_), and hyphens (-).
vpc_key1
Tag value
Can contain a maximum of 43 characters.
Can contain letters, digits, underscores (_), periods (.), and hyphens (-).
vpc-01
¶ Parameter
Requirement
Example Value
Tag key
Cannot be left blank.
Must be unique for each subnet.
Can contain a maximum of 36 characters.
Can contain letters, digits, underscores (_), and hyphens (-).
subnet_key1
Tag value
Can contain a maximum of 43 characters.
Can contain letters, digits, underscores (_), periods (.), and hyphens (-).
subnet-01
Click Create Now.
Step 2: Create a CCE Cluster¶
Creating a CCE cluster
Log in to the CCE console and create a cluster.
Complete the network settings as follows.
Network Model: Select Tunnel network.
VPC: Select the created VPC vpc-ipv6.
Subnet: Select a subnet with IPv6 enabled.
IPv6: Enable this function. After this function is enabled, cluster resources, including nodes and workloads, can be accessed through IPv6 CIDR blocks.
Container CIDR Block: A proper mask must be set for the container CIDR block. The mask determines the number of available nodes in the cluster. If the mask of the container CIDR block in the cluster is set improperly, there will be only a small number of available nodes in the cluster.
Create a node.
The CCE console displays the nodes that support IPv6. You can directly select a node.
After the creation is complete, access the cluster details page. Then, click the node name to go to the ECS details page and view the automatically allocated IPv6 address.