In an IPv4/IPv6 dual-stack cluster, the IPv6 addresses assigned to pods do not have IPv6 public bandwidth enabled by default, preventing communication with the Internet. This topic describes how to enable the IPv6 public bandwidth feature for a pod during creation, enabling it to access the Internet via IPv6.
When you create an IPv4/IPv6 dual-stack VPC and subnets, and then use the VPC and subnets to create a dual-stack cluster, the system will automatically assign IPv6 addresses to the nodes and pods within the cluster. By default, pods in the cluster have only IPv6 addresses and can only access private networks. To allow a pod to access the public network via its IPv6 address, follow the configuration method described in this topic and enable the IPv6 public bandwidth feature for the pod before it is created.
- VPC and subnet have been bound to an IPv6 gateway. For details, see Enabling IPv6 for VPC. If you cannot access the IPv6 gateway console, please contact your account manager.
- (Optional) If you plan to use a shared bandwidth package, you need to create a shared bandwidth package that supports the IPv4/IPv6 dual-stack protocol in advance. See Creating a Shared Bandwidth Package.
- We recommend that you uniformly configure the IPv6 public bandwidth feature for pods through the method described in this topic. After configuration is complete, do not manually modify the settings (e.g., billing method and bandwidth cap) on the IPv6 gateway console. Otherwise, configuration inconsistencies between the two sides may occur, potentially leading to abnormal or unexpected behavior when pods in the cluster access the public network via IPv6.
- The IPv6 public bandwidth feature for a pod can only be configured during its initial creation. Modifying the annotation after successful configuration will not take effect.
- Trunk ENI does not support IPv6 public bandwidth.
- Only clusters using the VPC-CNI network model support configuring the IPv6 public bandwidth feature for pods.
- A VPC can be configured with only one IPv6 gateway.
- IPv6 gateway instances have the following limitations:
- A single account can enable public bandwidth for a maximum of 20 IPv6 addresses in a single region.
- Each IPv6 gateway instance supports a maximum of 200 outbound-only rules.
tip
- For more details on limitations, see Limits.
- To request an increase in the above quota limits, go to Quota Center to submit an application.
Step 1: Install an add-on
- In the left navigation bar, click Cluster. On the page that appears, click the name of the target cluster to go to the management page of the cluster.
- On the cluster management page, click Addons in the left navigation bar.
- Select the Network tab, hover your mouse over the vpc-cni-controlplane add-on card, click Deploy, and enable Bind EIP to pods in the configuration dialog that appears.
tip
If an existing cluster already has the vpc-cni-controlplane add-on installed, ensure it has been upgraded to version 1.5.3 or later. For details, see Upgrading add-ons. Step 2: Configure IPv6 public network bandwidth for pods
VKE configures IPv6 public bandwidth for pods through instance annotations.
warning
The configuration of IPv6 public bandwidth for a pod applies regardless of whether the pod is scheduled to a regular node or a VCI node.
Taking a stateless Deployment as an example, you can add an annotation during configuration to set up IPv6 public bandwidth for the pods. The following content in YAML is an example with descriptions:
- Create the YAML file of the workload. The code of the sample file deployment-demo.yaml is as follows:
- The key parameters are described in the following table.
- Run the following command to create the workload.
When the pod reaches the Running state, you can use the following methods to verify whether the configuration is correct.
- Click the Pod name to enter the Pod details page.
tip
The status annotation ipv6gateway-bandwidth-status is added to the pod asynchronously with pod startup. To avoid scenarios where the pod starts normally but its network resources are unavailable, you can use an initContainer to continuously monitor this annotation and start the business pod only after the annotation reaches the expected state.
- Log in to the IPv6 Gateway console and click the IPv6 gateway name corresponding to your VPC to enter the gateway details page. On the IPv6 Internet bandwidth tab, use the IPv6 address of the Pod to search and confirm that the configuration matches the expected settings.
- Log in to the pod console and execute the following commands to verify connectivity.
- The expected output is as follows:
-