You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/virt-creating-a-primary-cluster-udn.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ spec:
41
41
<3> Specifies the type of selector. In this example, the `matchExpressions` selector selects objects that have the label `kubernetes.io/metadata.name` with the value `red-namespace` or `blue-namespace`.
42
42
<4> Specifies the type of operator. Possible values are `In`, `NotIn`, and `Exists`.
43
43
<5> Specifies the topological configuration of the network. The required value is `Layer2`. A `Layer2` topology creates a logical switch that is shared by all nodes.
44
-
<6> Specifies if the UDN is primary or secondary. {VirtProductName} only supports the `Primary` role. This means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
44
+
<6> Specifies whether the UDN is primary or secondary. The `Primary` role means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
45
45
46
46
. Apply the `ClusterUserDefinedNetwork` manifest by running the following command:
Copy file name to clipboardExpand all lines: modules/virt-creating-a-primary-udn.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ spec:
36
36
<1> Specifies the name of the `UserDefinedNetwork` custom resource.
37
37
<2> Specifies the namespace in which the VM is located. The namespace must have the `k8s.ovn.org/primary-user-defined-network` label. The namespace must not be `default`, an `openshift-*` namespace, or match any global namespaces that are defined by the Cluster Network Operator (CNO).
38
38
<3> Specifies the topological configuration of the network. The required value is `Layer2`. A `Layer2` topology creates a logical switch that is shared by all nodes.
39
-
<4> Specifies if the UDN is primary or secondary. {VirtProductName} only supports the `Primary` role. This means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
39
+
<4> Specifies whether the UDN is primary or secondary. The `Primary` role means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
40
40
<5> Specifies that virtual workloads have consistent IP addresses across reboots and migration. The `spec.layer2.subnets` field is required when `ipam.lifecycle: Persistent` is specified.
41
41
42
42
. Apply the `UserDefinedNetwork` manifest by running the following command:
<2> Specifies the nodes to which the node network configuration policy is applied. The recommended node selector value is `node-role.kubernetes.io/worker: ''`.
38
+
<3> The name of the additional network from which traffic is forwarded to the OVS bridge. This attribute must match the value of the `spec.network.localnet.physicalNetworkName` field of the `ClusterUserDefinedNetwork` object that defines the OVN-Kubernetes additional network. This example uses the name `tenantblue`.
39
+
<4> The name of the OVS bridge on the node. This value is required if the `state` attribute is `present` or not specified.
40
+
<5> The state of the mapping. Must be either `present` to add the mapping or `absent` to remove the mapping. The default value is `present`.
41
+
+
42
+
[IMPORTANT]
43
+
====
44
+
{VirtProductName} does not support Linux bridge bonding modes 0, 5, and 6. For more information, see link:https://access.redhat.com/solutions/67546[Which bonding modes work when used with a bridge that virtual machine guests or containers connect to?].
45
+
====
46
+
47
+
. Apply the `NodeNetworkConfigurationPolicy` manifest by running the following command:
48
+
+
49
+
[source,terminal]
50
+
----
51
+
$ oc apply -f <filename>.yaml
52
+
----
53
+
+
54
+
where:
55
+
56
+
<filename>:: Specifies the name of your `NodeNetworkConfigurationPolicy` manifest YAML file.
57
+
58
+
. Create a `ClusterUserDefinedNetwork` object to create a localnet secondary network:
59
+
+
60
+
.Example `ClusterUserDefinedNetwork` manifest
61
+
[source,yaml]
62
+
----
63
+
apiVersion: k8s.ovn.org/v1
64
+
kind: ClusterUserDefinedNetwork
65
+
metadata:
66
+
name: cudn-localnet # <1>
67
+
spec:
68
+
namespaceSelector: # <2>
69
+
matchExpressions: # <3>
70
+
- key: kubernetes.io/metadata.name
71
+
operator: In # <4>
72
+
values: ["red", "blue"]
73
+
network:
74
+
topology: Localnet # <5>
75
+
localnet:
76
+
role: Secondary # <6>
77
+
physicalNetworkName: tenantblue # <7>
78
+
ipam:
79
+
mode: Disabled # <8>
80
+
# ...
81
+
----
82
+
<1> The name of the `ClusterUserDefinedNetwork` custom resource.
83
+
<2> The set of namespaces that the cluster UDN applies to. The namespace selector must not point to the following values: `default`; an `openshift-*` namespace; or any global namespaces that are defined by the Cluster Network Operator (CNO).
84
+
<3> The type of selector. In this example, the `matchExpressions` selector selects objects that have the label `kubernetes.io/metadata.name` with the value `red` or `blue`.
85
+
<4> The type of operator. Possible values are `In`, `NotIn`, and `Exists`.
86
+
<5> The topological configuration of the network. A `Localnet` topology connects the logical network to the physical underlay.
87
+
<6> Specifies whether the UDN is primary or secondary. The required value is `Secondary` for `topology: Localnet`.
88
+
<7> The name of the OVN-Kubernetes bridge mapping that is configured on the node. This value must match the `spec.desiredState.ovn.bridge-mappings.localnet` field in the `NodeNetworkConfigurationPolicy` manifest that you previously created. This ensures that you are bridging to the intended segment of your physical network.
89
+
<8> Specifies whether IP address management (IPAM) is enabled or disabled. The required value is `Disabled`. {VirtProductName} does not support configuring IPAM for virtual machines.
90
+
91
+
. Apply the `ClusterUserDefinedNetwork` manifest by running the following command:
92
+
+
93
+
[source,terminal]
94
+
----
95
+
$ oc apply -f <filename>.yaml
96
+
----
97
+
+
98
+
where:
99
+
100
+
<filename>:: Specifies the name of your `ClusterUserDefinedNetwork` manifest YAML file.
You can connect a virtual machine (VM) to an OVN-Kubernetes secondary network. {VirtProductName} supports the `layer2`and `localnet` topologies for OVN-Kubernetes.
16
+
You can connect a virtual machine (VM) to an OVN-Kubernetes `layer2`secondary network by using the CLI.
17
17
18
-
* A `layer2` topology connects workloads by a cluster-wide logical switch. The OVN-Kubernetes Container Network Interface (CNI) plugin 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.
19
-
20
-
* 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.
18
+
A `layer2` topology connects workloads by a cluster-wide logical switch. The OVN-Kubernetes Container Network Interface (CNI) plugin 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.
21
19
22
20
[NOTE]
23
21
====
24
-
An OVN-Kubernetes secondary network is compatible with the xref:../../networking/multiple_networks/secondary_networks/configuring-multi-network-policy.adoc#compatibility-with-multi-network-policy_configuring-additional-network[multi-network policy API] which provides the `MultiNetworkPolicy` custom resource definition (CRD) to control traffic flow to and from VMs. You can use the `ipBlock` attribute to define network policy ingress and egress rules for specific CIDR blocks.
22
+
An OVN-Kubernetes secondary network is compatible with the xref:../../networking/multiple_networks/secondary_networks/configuring-multi-network-policy.adoc#compatibility-with-multi-network-policy_configuring-additional-network[multi-network policy API] which provides the `MultiNetworkPolicy` custom resource definition (CRD) to control traffic flow to and from VMs. You must use the `ipBlock` attribute to define network policy ingress and egress rules for specific CIDR blocks. You cannot use pod or namespace selectors for virtualization workloads.
To configure an OVN-Kubernetes secondary network and attach a VM to that network, perform the following steps:
26
+
To configure an OVN-Kubernetes `layer2`secondary network and attach a VM to that network, perform the following steps:
29
27
30
-
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#virt-connecting-vm-to-ovn-secondary-network[Configure an OVN-Kubernetes secondary network] by creating a network attachment definition (NAD).
For `localnet` topology, you must xref:../../networking/multiple_networks/secondary_networks/creating-secondary-nwt-ovnk.adoc#configuration-localnet-switched-topology_configuring-additional-network-ovnk[configure an OVS bridge] by creating a `NodeNetworkConfigurationPolicy` object before creating the NAD.
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#virt-connecting-vm-to-ovn-secondary-network[Configure an OVN-Kubernetes layer 2 secondary network].
38
29
39
-
. 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.
30
+
. 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 layer 2 secondary network].
40
31
41
32
[id="creating-ovn-nad_{context}"]
42
-
== Creating an OVN-Kubernetes NAD
33
+
== Creating an OVN-Kubernetes layer 2 NAD
43
34
44
-
You can create an OVN-Kubernetes network attachment definition (NAD) by using the {product-title} web console or the CLI.
35
+
You can create an OVN-Kubernetes network attachment definition (NAD) for the layer 2 network topology by using the {product-title} web console or the CLI.
45
36
46
37
[NOTE]
47
38
====
@@ -50,20 +41,20 @@ Configuring IP address management (IPAM) by specifying the `spec.config.ipam.sub
= Connecting a virtual machine to a secondary localnet user-defined network
4
+
include::_attributes/common-attributes.adoc[]
5
+
:context: virt-connecting-vm-to-secondary-udn
6
+
7
+
toc::[]
8
+
9
+
You can connect a virtual machine (VM) to an OVN-Kubernetes localnet secondary network by using the CLI. Cluster administrators can use the `ClusterUserDefinedNetwork` (CUDN) custom resource definition (CRD) to create a shared OVN-Kubernetes network across multiple namespaces.
10
+
11
+
An OVN-Kubernetes secondary network is compatible with the xref:../../networking/multiple_networks/secondary_networks/configuring-multi-network-policy.adoc#compatibility-with-multi-network-policy_configuring-additional-network[multi-network policy API] which provides the `MultiNetworkPolicy` custom resource definition (CRD) to control traffic flow to and from VMs.
12
+
13
+
[IMPORTANT]
14
+
====
15
+
You must use the `ipBlock` attribute to define network policy ingress and egress rules for specific CIDR blocks. Using pod or namespace selector policy peers is not supported.
16
+
====
17
+
18
+
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.
* xref:../../networking/multiple_networks/primary_networks/about-user-defined-networks.adoc#about-cudn_about-user-defined-networks[About the `ClusterUserDefinedNetwork` CR]
0 commit comments