Skip to content

Commit 2e50da9

Browse files
authored
Merge pull request #70729 from sjhala-ccs/cnv-13682
CNV#13682: Added procedure for OVN-K localnet topology
2 parents 087e74d + 2fc9db1 commit 2e50da9

5 files changed

+84
-11
lines changed

modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
pod: {}
4141
- name: secondary <2>
4242
multus:
43-
networkName: l2-network <3>
43+
networkName: <nad_name> <3>
4444
# ...
4545
----
4646
<1> The name of the OVN-Kubernetes secondary interface.

modules/virt-creating-layer2-nad-cli.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="virt-creating-layer2-nad-cli_{context}"]
7-
= Creating a NAD for flat layer 2 topology using the CLI
7+
= Creating a NAD for layer 2 topology using the CLI
88

99
You can create a network attachment definition (NAD) which describes how to attach a pod to the layer 2 overlay network.
1010

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="virt-creating-localnet-nad-cli_{context}"]
7+
= Creating a NAD for localnet topology using the CLI
8+
9+
You can create a network attachment definition (NAD) which describes how to attach a pod to the underlying physical network.
10+
11+
.Prerequisites
12+
* You have access to the cluster as a user with `cluster-admin` privileges.
13+
* You have installed the OpenShift CLI (`oc`).
14+
* You have installed the Kubernetes NMState Operator.
15+
* You have created a `NodeNetworkConfigurationPolicy` object to map the OVN-Kubernetes secondary network to an Open vSwitch (OVS) bridge.
16+
17+
.Procedure
18+
19+
. Create a `NetworkAttachmentDefinition` object:
20+
+
21+
[source,yaml]
22+
----
23+
apiVersion: k8s.cni.cncf.io/v1
24+
kind: NetworkAttachmentDefinition
25+
metadata:
26+
name: localnet-network
27+
namespace: default
28+
spec:
29+
config: |2
30+
{
31+
"cniVersion": "0.3.1", <1>
32+
"name": "localnet-network", <2>
33+
"type": "ovn-k8s-cni-overlay", <3>
34+
"topology": "localnet", <4>
35+
"netAttachDefName": "default/localnet-network" <5>
36+
}
37+
----
38+
<1> The CNI specification version. The required value is `0.3.1`.
39+
<2> The name of the network. This attribute must match the value of the `spec.desiredState.ovn.bridge-mappings.localnet` field of the `NodeNetworkConfigurationPolicy` object that defines the OVS bridge mapping.
40+
<3> The name of the CNI plug-in to be configured. The required value is `ovn-k8s-cni-overlay`.
41+
<4> The topological configuration for the network. The required value is `localnet`.
42+
<5> The value of the `namespace` and `name` fields in the `metadata` stanza of the `NetworkAttachmentDefinition` object.
43+
44+
. Apply the manifest:
45+
+
46+
[source,terminal]
47+
----
48+
$ oc apply -f <filename>.yaml
49+
----
50+

virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,27 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
You can connect a virtual machine (VM) to an Open Virtual Network (OVN)-Kubernetes secondary network. The OVN-Kubernetes Container Network Interface (CNI) plug-in uses the Geneve (Generic Network Virtualization Encapsulation) protocol to create an overlay network between nodes.
9+
You can connect a virtual machine (VM) to an Open Virtual Network (OVN)-Kubernetes secondary network. {VirtProductName} supports the layer 2 and localnet topologies for OVN-Kubernetes.
1010

11-
{VirtProductName} currently supports the flat layer 2 topology. This topology connects workloads by a cluster-wide logical switch. You can use this overlay network to connect VMs on different nodes, without having to configure any additional physical networking infrastructure.
11+
* A layer 2 topology connects workloads by a cluster-wide logical switch. The OVN-Kubernetes Container Network Interface (CNI) plug-in uses the Geneve (Generic Network Virtualization Encapsulation) protocol to create an overlay network between nodes. You can use this overlay network to connect VMs on different nodes, without having to configure any additional physical networking infrastructure.
12+
13+
* A localnet topology connects the secondary network to the physical underlay. This enables both east-west cluster traffic and access to services running outside the cluster, but it requires additional configuration of the underlying Open vSwitch (OVS) system on cluster nodes.
1214
1315
To configure an OVN-Kubernetes secondary network and attach a VM to that network, perform the following steps:
1416

15-
. Create a network attachment definition (NAD) by using the web console or the xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#virt-creating-layer2-nad-cli_virt-connecting-vm-to-ovn-secondary-network[CLI].
17+
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#creating-ovn-nad[Configure an OVN-Kubernetes secondary network] by creating a network attachment definition (NAD).
18+
+
19+
[NOTE]
20+
====
21+
For localnet topology, you must xref:../../networking/multiple_networks/configuring-additional-network.adoc#configuring-additional-network_ovn-kubernetes-configuration-for-a-localnet-topology[configure an OVS bridge] by creating a `NodeNetworkConfigurationPolicy` object before creating the NAD.
22+
====
1623

17-
. Add information about the secondary network interface to the VM specification by using the web console or the xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#virt-attaching-vm-to-ovn-secondary-nw-cli_virt-connecting-vm-to-ovn-secondary-network[CLI].
24+
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#attaching-vm-to-ovn-secondary-nw[Connect the VM to the OVN-Kubernetes secondary network] by adding the network details to the VM specification.
1825

19-
[id="creating-ovn-layer2-nad"]
26+
[id="creating-ovn-nad"]
2027
== Creating an OVN-Kubernetes NAD
2128

22-
You can create an OVN-Kubernetes flat layer 2 network attachment definition (NAD) by using the {product-title} web console or the CLI.
29+
You can create an OVN-Kubernetes layer 2 or localnet network attachment definition (NAD) by using the {product-title} web console or the CLI.
2330

2431
[NOTE]
2532
====
@@ -28,6 +35,8 @@ Configuring IP address management (IPAM) in a network attachment definition for
2835

2936
include::modules/virt-creating-layer2-nad-cli.adoc[leveloffset=+2]
3037

38+
include::modules/virt-creating-localnet-nad-cli.adoc[leveloffset=+2]
39+
3140
[id="attaching-vm-to-ovn-secondary-nw"]
3241
== Attaching a virtual machine to the OVN-Kubernetes secondary network
3342

@@ -38,4 +47,5 @@ include::modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc[leveloffset=+2]
3847
[role="_additional-resources"]
3948
[id="additional-resources_virt-connecting-vm-to-ovn-secondary-network"]
4049
== Additional resources
41-
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#configuration-ovnk-additional-networks_configuring-additional-network[Configuration for an OVN-Kubernetes additional network]
50+
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#configuration-ovnk-additional-networks_configuring-additional-network[Configuration for an OVN-Kubernetes additional network]
51+
* xref:../../networking/k8s_nmstate/k8s-nmstate-about-the-k8s-nmstate-operator.adoc#k8s-nmstate-about-the-k8s-nmstate-operator[About the Kubernetes NMState Operator]

virt/vm_networking/virt-networking-overview.adoc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,22 @@ You can connect a VM to an SR-IOV network by performing the following steps:
5050

5151
xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#virt-connecting-vm-to-ovn-secondary-network[Connecting a virtual machine to an OVN-Kubernetes secondary network]::
5252

53-
You can connect a VM to an Open Virtual Network (OVN)-Kubernetes secondary network. To configure an OVN-Kubernetes secondary network and attach a VM to that network, perform the following steps:
53+
You can connect a VM to an Open Virtual Network (OVN)-Kubernetes secondary network. {VirtProductName} supports the layer 2 and localnet topologies for OVN-Kubernetes.
54+
+
55+
--
56+
* A layer 2 topology connects workloads by a cluster-wide logical switch. The OVN-Kubernetes Container Network Interface (CNI) plug-in uses the Geneve (Generic Network Virtualization Encapsulation) protocol to create an overlay network between nodes. You can use this overlay network to connect VMs on different nodes, without having to configure any additional physical networking infrastructure.
57+
58+
* A localnet topology connects the secondary network to the physical underlay. This enables both east-west cluster traffic and access to services running outside the cluster, but it requires additional configuration of the underlying Open vSwitch (OVS) system on cluster nodes.
59+
--
60+
+
61+
To configure an OVN-Kubernetes secondary network and attach a VM to that network, perform the following steps:
5462

55-
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#creating-ovn-layer2-nad[Configure an OVN-Kubernetes secondary network] by creating a `NetworkAttachmentDefinition` CRD.
63+
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#creating-ovn-nad[Configure an OVN-Kubernetes secondary network] by creating a network attachment definition (NAD).
64+
+
65+
[NOTE]
66+
====
67+
For localnet topology, you must xref:../../networking/multiple_networks/configuring-additional-network.adoc#configuring-additional-network_ovn-kubernetes-configuration-for-a-localnet-topology[configure an OVS bridge] by creating a `NodeNetworkConfigurationPolicy` object before creating the NAD.
68+
====
5669

5770
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#attaching-vm-to-ovn-secondary-nw[Connect the VM to the OVN-Kubernetes secondary network] by adding the network details to the VM specification.
5871

0 commit comments

Comments
 (0)