If a project or namespace is assigned multiple subnets, an IP address will be randomly selected from one of the subnets.
Project Allocation:
Namespace Allocation:
Creating subnets in the Calico network to achieve finer granularity of network isolation for resources within the cluster.
In an IPv6 cluster environment, the subnets created within the Calico network, by default, use VXLAN encapsulation. The ports required for VXLAN encapsulation differ from those of IPIP encapsulation. You need to ensure that UDP port 4789 is open.
default
If true, use VXLAN encapsulation.Go to Platform Management.
In the left navigation bar, click Network Management > Subnets.
Click Create Subnet.
Refer to the following instructions to configure the relevant parameters.
Parameter | Description |
---|---|
CIDR | After allocating the subnet to a project or namespace, the container groups within the namespace will randomly use IP addresses within this CIDR for communication. Note: For the correspondence between CIDR and BlockSize, please refer to Reference Content. |
Encapsulation Protocol | Select the encapsulation protocol. IPIP is not supported in dual-stack mode.
|
Encapsulation Mode | When the encapsulation protocol is IPIP or VXLAN, the encapsulation mode must be set, defaulting to Always.
|
Outbound Traffic NAT | Choose whether to enable outbound traffic NAT (Network Address Translation), which is enabled by default. It is primarily used to set the access addresses exposed to the external network when the subnet container group accesses the external network. When outbound traffic NAT is enabled, the host IP will be used as the access address for the current subnet container group; when not enabled, the IPs of the container groups in the subnet will be directly exposed to the external network. |
Click Confirm.
On the subnet details page, select Actions > Allocate Project / Allocate Namespace.
Complete the configuration and click Allocate.
The dynamic matching relationship between CIDR and blockSize is shown in the table below.
CIDR | blockSize Size | Number of Hosts | Size of a Single IP Pool |
---|---|---|---|
prefix<=16 | 26 | 1024+ | 64 |
16<prefix<=19 | 27 | 256~1024 | 32 |
prefix=20 | 28 | 256 | 16 |
prefix=21 | 29 | 256 | 8 |
prefix=22 | 30 | 256 | 4 |
prefix=23 | 30 | 128 | 4 |
prefix=24 | 30 | 64 | 4 |
prefix=25 | 30 | 32 | 4 |
prefix=26 | 31 | 32 | 2 |
prefix=27 | 31 | 16 | 2 |
prefix=28 | 31 | 8 | 2 |
prefix=29 | 31 | 4 | 2 |
prefix=30 | 31 | 2 | 2 |
prefix=31 | 31 | 1 | 2 |
Subnet configurations with prefixes greater than 31 are not supported.
Creating a subnet in the Kube-OVN Overlay Network to achieve more granular network isolation of resources in the cluster.
The platform has a built-in join subnet for communication between nodes and Pods; please avoid conflicts in network segments between join and newly created subnets.
distributed
or centralized
.Go to Platform Management.
In the left navigation bar, click on Network Management > Subnet.
Click on Create Subnet.
Refer to the following instructions to configure the related parameters.
Parameter | Description |
---|---|
Network Segment | After assigning the subnet to the project or namespace, IPs within this segment will be randomly allocated for use by Pods. |
Reserved IP | The set reserved IP will not be automatically allocated. For example, it can be used as the IP address for computing components' fixed IP. |
Gateway Type | Select the type of gateway for the subnet to control the outbound traffic. - Distributed: Each host in the cluster can act as an outbound node for Pods on the current host, enabling distributed egress. - Centralized: All Pods in the cluster use one or more specific hosts as outbound nodes, facilitating external auditing and firewall control. Setting multiple centralized gateway nodes can achieve high availability. |
ECMP (Alpha) | When choosing a Centralized gateway, the ECMP feature can be used. By default, the gateway operates in master-slave mode, with only the master gateway processing traffic. When enabling ECMP (Equal-Cost Multipath Routing), outbound traffic will be routed through multiple equal-cost paths to all available gateway nodes, thereby increasing the total throughput of the gateway. Note: Please enable ECMP-related features in advance. |
Gateway Nodes | When using a Centralized gateway, select one or more specific hosts as gateway nodes. |
Outbound Traffic NAT | Choose whether to enable outbound traffic NAT (Network Address Translation). By default, it is enabled. It is mainly used to set the access address exposed to the external network when the Pods in the subnet access the internet. When outbound traffic NAT is enabled, the host IP will be used as the access address for the Pods in the current subnet; when not enabled, the IPs of the Pods within the subnet will be directly exposed to the external network. In this case, using a centralized gateway is recommended. |
Click Confirm.
On the subnet details page, select Actions > Allocate Project / Namespace.
Complete the configuration and click Allocate.
Creating subnets in the Kube-OVN Underlay network not only enables finer-grained network isolation for resources but also provides a better performance experience.
The container network in Kube-OVN Underlay requires support from the physical network. Please refer to the best practices Preparing the Kube-OVN Underlay Physical Network to ensure network connectivity.
The general process for creating subnets in the Kube-OVN Underlay network is: Add Bridge Network > Add VLAN > Create Subnet.
A bridge network refers to a bridge, and after binding the network card to the bridge, it can forward container network traffic, achieving intercommunication with the physical network.
Procedure:
Go to Platform Management.
In the left navigation bar, click Network Management > Bridge Network.
Click Add Bridge Network.
Configure the relevant parameters based on the following instructions.
Note:
Target Pod refers to all Pods scheduled on the current node or Pods in namespaces bound to specific subnets scheduled to the current node. This depends on the scope of the subnet under the bridge network.
The nodes in the Underlay subnet must have multiple network cards, and the network card used by the bridge network must be exclusively assigned to the Underlay and cannot carry other traffic, such as SSH. For example, if the bridge network has three nodes planning for eth0, eth0, eth1 for exclusive use by the Underlay, then the default network card can be set as eth0, and the network card for node three can be eth1.
Parameter | Description |
---|---|
Default Network Card Name | By default, the target Pod will use this as the bridge network card for intercommunication with the physical network. |
Configure Network Card by Node | The target Pods on the configured nodes will bridge to the specified network card instead of the default network card. |
Exclude Nodes | When nodes are excluded, all Pods scheduled to these nodes will not bridge to any network card on these nodes. Note: Pods on excluded nodes will not be able to communicate with the physical network or cross-node container networks, and care should be taken to avoid scheduling related Pods to these nodes. |
Click Add.
The platform has a pre-configured ovn-vlan virtual LAN, which will connect to the provider bridge network. You can also configure a new VLAN to connect to other bridge networks, thereby achieving network isolation between VLANs.
Procedure:
Navigate to Platform Management.
In the left navigation bar, click Network Management > VLAN.
Click Add VLAN.
Configure the relevant parameters based on the following instructions.
Parameter | Description |
---|---|
VLAN ID | The unique identifier for this VLAN, which will be used to differentiate different virtual LANs. |
Bridge Network | The VLAN will connect to this bridge network for intercommunication with the physical network. |
Click Add.
The platform also pre-configures a join subnet for communication between nodes and Pods in Overlay transport mode. This subnet will not be used in Underlay transport mode, so it is crucial to avoid IP segment conflicts between join and other subnets.
Procedure:
Navigate to Platform Management.
In the left navigation bar, click Network Management > Subnet.
Click Create Subnet.
Configure the relevant parameters based on the following instructions.
Parameter | Description |
---|---|
VLAN | The VLAN to which the subnet belongs. |
Subnet | After assigning the subnet to a project or namespace, IPs within the physical subnet will be randomly allocated for use by Pods. |
Gateway | The physical gateway within the above subnet. |
Reserved IP | The specified reserved IP will not be automatically assigned. For example, it can be used as the IP for the compute component fixed IP. |
Click Confirm.
On the subnet details page, select Action > Assign Project / Namespace.
Complete the configuration and click Assign.
When both Underlay and Overlay subnets exist in a cluster, you can configure the Automatic Intercommunication Between Underlay and Overlay Subnets as needed.
This includes changing the outbound traffic method, gateway nodes, and NAT configuration.
Go to Platform Management.
In the left sidebar, click on Network Management > Subnets.
Click the name of the subnet.
Select Action > Update Gateway.
Update the parameter configurations; refer to the Parameter Description for details.
Click OK.
The gateway IP cannot be removed from the reserved IPs, while other reserved IPs can be edited, deleted, or added freely.
Go to Platform Management.
In the left sidebar, click on Network Management > Subnets.
Click the name of the subnet.
Select Action > Update Reserved IP.
After completing the updates, click Update.
Assigning subnets to specific projects helps teams better manage and isolate network traffic for different projects, ensuring that each project has sufficient network resources.
Navigate to Platform Management.
In the left sidebar, click on Network Management > Subnets.
Click the name of the subnet.
Select Action > Assign Project.
After adding or removing projects, click Assign.
Assigning subnets to specific namespaces allows for finer network isolation.
Note: The assignment process will rebuild the gateway, and outbound data packets will be discarded! Please ensure no business applications are currently accessing external clusters.
Navigate to Platform Management.
In the left sidebar, click on Network Management > Subnets.
Click the name of the subnet.
Select Action > Assign Namespace.
After adding or removing namespaces, click Assign.
When the reserved IP range of a subnet reaches its usage limit or is about to be exhausted, it can be expanded based on the original subnet range without affecting the normal operation of existing services.
Navigate to Platform Management.
In the left sidebar, click on Network Management > Subnets.
Click the name of the subnet.
Select Action > Expand Subnet.
Complete the configuration and click Update.
Support for assigning projects and namespaces; for details, please refer to the project assignment and namespace assignment.
When a subnet is deleted, if there are still container groups using the IPs within the subnet, the container groups can continue to run and the IP addresses will remain unchanged, but they will be unable to communicate over the network. The container groups can be rebuilt to use IPs within the default subnet, or assign a new subnet to the namespace where the container groups reside for usage.
The default subnet cannot be deleted.
Go to Platform Management.
In the left navigation bar, click Network Management > Subnets.
Click ⋮ > Delete, and proceed with the deletion.