Virtual Machine Networking¶
This article will introduce how to configure network information when creating virtual machines.
In virtual machines, network management is a crucial part that allows us to manage and configure network connections for virtual machines in a Kubernetes environment. It can be configured according to different needs and scenarios, achieving a more flexible and diverse network architecture.
- Single NIC Scenario: For simple applications that only require basic network connectivity or when there are resource constraints, using a single NIC can save network resources and prevent waste of resources.
- Multiple NIC Scenario: When security isolation between different network environments needs to be achieved, multiple NICs can be used to divide different network areas. It also allows for control and management of traffic.
Network Configuration¶
-
Network configuration can be combined according to the table information.
Network Mode CNI Spiderpool Installed NIC Mode Fixed IP Live Migration Masquerade (NAT) Calico ❌ Single NIC ❌ ✅ Cilium ❌ Single NIC ❌ ✅ Flannel ❌ Single NIC ❌ ✅ Passt (Direct) macvlan ✅ Single NIC ✅ ✅ ipvlan ✅ Multiple NIC ✅ ✅ Bridge OVS ✅ Multiple NIC ✅ ✅ -
Network Mode: There are three modes - Masquerade (NAT), Passt (Direct), and Bridge. The latter two modes require the installation of the spiderpool component to use.
-
The default selection is Masquerade (NAT) network mode using the eth0 default NIC.
-
If the cluster has the spiderpool component installed, then Passt (Direct) / Bridge modes can be selected. The Bridge mode supports multiple NICs.
- When selecting Passt mode, there are some prerequisites.
- Create macvlan or ipvlan type Multus CR. Refer to Creating macvlan or ipvlan type Multus CR
- Create subnets and IP pools. Refer to Creating subnets and IP pools
- When selecting Bridge mode, there are some prerequisites.
- Create ovs type Multus CR, currently cannot be created on the page. Refer to Creating ovs type Multus CR
- Create subnets and IP pools similar to passt mode.
-
-
Adding NICs
-
Passt (Direct) / Bridge modes support manually adding NICs. Click on Add NIC to configure the NIC IP pool. Choose a Multus CR that matches the network mode, if not available, it needs to be created manually.
-
If the Use Default IP Pool switch is turned on, it will use the default IP pool in the multus CR configuration. If turned off, manually select the IP pool.
-