Create a subnet (Kube-OVN underlay network)
Creating a subnet in Kube-OVN underlay network not only enables finer-grained network isolation of resources, but also provides better performance experience.
Note: In the Kube-OVN underlay transmission mode, the container network relies on physical network support. Please refer to the best practice Preparing Kube-OVN Underlay Physical Network to ensure network connectivity.
IP assignment rules
-
If a namespace in the cluster is not bound to a subnet, the Pods in this namespace will use the default subnet (ovn-default) by default. If the IP addresses of the default subnet are not enough, the Pods cannot be started.
-
If a namespace in the cluster is already bound to a subnet, the Pods in this namespace will use the IP addresses in this subnet by default.
-
If the cluster has multiple subnets, Developers can specify a subnet for applications with specific business needs in a namespace. In this case, regardless of whether the namespace is bound to a subnet or not, the Pods can only use the IP addresses in this subnet.
Usage guidelines
The general process of creating a subnet in Kube-OVN underlay network is: add a bridge network > add a VLAN > create a subnet.
(Optional) Add a bridge network
A bridge network, or a bridge, binds a network card to a bridge, which can forward container network traffic and achieve interoperability with the physical network.
Procedure
-
On the left navigation bar, click Networking > Bridge Networks.
-
Click Add Bridge Network.
-
Configure the relevant parameters according to the following instructions.
Note:
-
Target Container Group refers to the container group scheduled to the current node, or the container group in the namespace scheduled to the current node and bound to a specific subnet. The specific scope depends on the subnet of the bridged network.
-
The node of the Underlay subnet must have multiple network cards, and the network card used by the bridged network must be exclusively used by Underlay and cannot carry other traffic, such as SSH. For example, if the bridged network has three nodes, and eth0, eth0, and eth1 are planned for exclusive use by the Underlay subnet, the default network card can be set to eth0, and the third network card of the node can be set to eth1.
Parameter Description Default NIC name By default, the target container group will use this as the bridged network card to communicate with the physical network. Configure network card by node The target container group on the configured node will be bridged to the specified network card instead of the default network card. Excluded Nodes After excluding a node, all container groups scheduled to this node will not be bridged to any network card on this node.
Caution: Container groups on the excluded node will be unable to communicate with the physical network or cross-node container network, so container groups with relevant requirements should be avoided from being scheduled to this node. -
-
Click Add.
(Optional) Add a VLAN
The platform comes with a preconfigured ovn-vlan virtual LAN, which will be connected to the provider bridged network. You can also configure a new VLAN to connect to other bridged networks, and network isolation will be achieved between different VLANs.
Procedure
-
Click Networking > VLAN on the left navigation bar.
-
Click Add VLAN.
-
Configure the relevant parameters according to the following instructions.
Parameter Description VLAN ID The unique identifier of this VLAN, which will be used to divide different virtual LANs. Bridge Networks The VLAN will be connected to this bridged network to achieve interconnection with the physical network. -
Click Add.
Create the subnets and assign namespaces
Note: The platform also provides a preconfigured join subnet for communication between nodes and container groups in Overlay transmission mode. This subnet will not be used in Underlay transmission mode, so just avoid conflicts between the network segments of join and other subnets.
Procedure
-
Click Networking > Subnets on the left navigation bar.
-
Click Create Subnet.
-
Configure the relevant parameters according to the following instructions.
Parameter Description VLAN The VLAN to which the subnet belongs. Subnet After the subnet is assigned to the namespace, the IP addresses within this physical network segment will be randomly assigned to container groups. Gateway The physical gateway within the above network segment. Reserved IP Addresses Reserved IPs set will not be automatically assigned. For example, it can be used as the IP of the Static IP Address of a computing component. -
Click Confirm.
-
On the subnet details page, select Actions > Update Namespace.
-
Complete the configuration and click Update.
Relevant operations
When a cluster has both Underlay and Overlay subnets, you can configure automatic communication between Underlay and Overlay subnets as needed.