Skip to content

Commit 16b3945

Browse files
authored
Merge pull request #56657 from stevsmit/OSDOCS5450
Introduces secondary network configuration for OVNK in OCP docs
2 parents ee995ce + 786ef66 commit 16b3945

8 files changed

+237
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
:_content-type: REFERENCE
2+
[id="configuration-ovnk-network-plugin-json-object_{context}"]
3+
= OVN-Kubernetes network plugin JSON configuration table
4+
5+
The following table describes the configuration parameters for the OVN-Kubernetes CNI network plugin:
6+
7+
.OVN-Kubernetes network plugin JSON configuration table
8+
[cols=".^2,.^2,.^6",options="header"]
9+
|====
10+
|Field|Type|Description
11+
12+
|`cniVersion`
13+
|`string`
14+
|The CNI specification version. The required value is `0.3.1`.
15+
16+
|`name`
17+
|`string`
18+
|The name of the network. This value must be unique across all `NetworkAttachmentDefinitions`. Failure to make this attribute unique might result in the merging of two networks with the same name. Merging two networks by sharing similar names is unsupported.
19+
20+
|`type`
21+
|`string`
22+
|The name of the CNI plugin to configure. The required value is `ovn-k8s-cni-overlay`.
23+
24+
|`topology`
25+
|`string`
26+
|The topological configuration for the network. The required value is `layer2`.
27+
28+
|`subnets`
29+
|`string`
30+
| The subnet to use for the network across the cluster. When specifying `layer2` for the `topology`, only include the CIDR for the node. For example, `10.100.200.0/24`.
31+
32+
For `"topology":"layer2"` deployments, IPv6 (`2001:DBB::/64`) and dual-stack (`192.168.100.0/24,2001:DBB::/64`) subnets are supported.
33+
34+
|`mtu`
35+
|`string`
36+
|The maximum transmission unit (MTU) to the specified value. The default value, `1300`, is automatically set by the kernel.
37+
38+
|`netAttachDefName`
39+
|`string`
40+
| The namespace and the network attachment name. The value must match the values specified for `namespace` and `name` when defining the network attachment definition object. For example, `ns1/l2-network` refers to the `ns1` namespace and the `l2-network` network attachment definition name.
41+
42+
|`excludeSubnets`
43+
|`string`
44+
|A comma-separated list of CIDRs and IPs. IPs are removed from the assignable IP pool, and are never passed to the pods. When omitted, the logical switch implementing the network only provides layer 2 communication, and users must configure IPs for the pods. Port security only prevents MAC spoofing.
45+
46+
|====
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="configuration-layer-three-routed-topology_{context}"]
7+
= Configuration for a routed topology
8+
9+
The routed (layer 3) topology networks are a simplified topology for the cluster default network without egress or ingress. In this topology, there is one logical switch per node, each with a different subnet, and a router interconnecting all logical switches.
10+
11+
This configuration can be used for IPv6 and dual-stack deployments.
12+
13+
[NOTE]
14+
====
15+
* Layer 3 routed topology networks only allow for the transfer of data packets between pods within a cluster.
16+
* Creating a secondary network with an IPv6 subnet or dual-stack subnets fails on a single-stack {product-title} cluster. This is a known limitation and will be fixed a future version of {product-title}.
17+
====
18+
19+
The following `NetworkAttachmentDefinition` custom resource definition (CRD) YAML describes the fields needed to configure a routed secondary network.
20+
21+
[source,yaml]
22+
----
23+
{
24+
"cniVersion": "0.3.1",
25+
"name": "ns1-l3-network",
26+
"type": "ovn-k8s-cni-overlay",
27+
"topology":"layer3",
28+
"subnets": "10.128.0.0/16/24",
29+
"mtu": 1300,
30+
"netAttachDefName": "ns1/l3-network"
31+
}
32+
----
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="configuration-layer-two-switched-topology_{context}"]
7+
= Configuration for a switched topology
8+
9+
The switched (layer 2) topology networks interconnect the workloads through a cluster-wide logical switch. This configuration can be used for IPv6 and dual-stack deployments.
10+
11+
[NOTE]
12+
====
13+
Layer 2 switched topology networks only allow for the transfer of data packets between pods within a cluster.
14+
====
15+
16+
The following `NetworkAttachmentDefinition` custom resource definition (CRD) YAML describes the fields needed to configure a switched secondary network.
17+
18+
[source,yaml]
19+
----
20+
{
21+
"cniVersion": "0.3.1",
22+
"name": "ns1-l2-network",
23+
"type": "ovn-k8s-cni-overlay",
24+
"topology":"layer2",
25+
"subnets": "10.100.200.0/24",
26+
"mtu": 1300,
27+
"netAttachDefName": "ns1/l2-network",
28+
"excludeSubnets": "10.100.200.0/29"
29+
}
30+
----
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ovn_kubernetes_network_provider/configuring-secondary-networks.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="configuration-localnet-switched-topology_{context}"]
7+
= Configuration for a localnet switched topology
8+
9+
The switched (localnet) topology interconnects the workloads through a cluster-wide logical switch to a physical network.
10+
11+
The following `NetworkAttachmentDefinition` custom resource definition (CRD) YAML describes the fields needed to configure a localnet secondary network.
12+
13+
[source,yaml]
14+
----
15+
{
16+
"cniVersion": "0.3.1",
17+
"name": "ns1-localnet-network",
18+
"type": "ovn-k8s-cni-overlay",
19+
"topology":"localnet",
20+
"subnets": "202.10.130.112/28",
21+
"vlanID": 33,
22+
"mtu": 1500,
23+
"netAttachDefName": "ns1/localnet-network"
24+
"excludeSubnets": "10.100.200.0/29"
25+
26+
}
27+
----
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="configuration-ovnk-additional-networks_{context}"]
7+
= Configuration for an OVN-Kubernetes additional network
8+
9+
The {openshift-networking} OVN-Kubernetes network plugin allows the configuration of secondary network interfaces for pods. To configure secondary network interfaces, you must define the configurations in the `NetworkAttachmentDefinition` custom resource definition (CRD).
10+
11+
:FeatureName: Configuration for an OVN-Kubernetes additional network
12+
include::snippets/technology-preview.adoc[]
13+
14+
The following sections provide example configurations for each of the topologies that OVN-Kubernetes currently allows for secondary networks.
15+
16+
[NOTE]
17+
====
18+
Networks names must be unique. For example, creating multiple `NetworkAttachmentDefinition` CRDs with different configurations that reference the same network is unsupported.
19+
====
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="configuring-pods-secondary-network_{context}"]
7+
= Configuring pods for additional networks
8+
9+
You must specify the secondary network attachments through the `k8s.v1.cni.cncf.io/networks` annotation.
10+
11+
The following example provisions a pod with two secondary attachments, one for each of the attachment configurations presented in this guide.
12+
13+
[source,yaml]
14+
----
15+
apiVersion: v1
16+
kind: Pod
17+
metadata:
18+
annotations:
19+
k8s.v1.cni.cncf.io/networks: l2-network
20+
name: tinypod
21+
namespace: ns1
22+
spec:
23+
containers:
24+
- args:
25+
- pause
26+
image: k8s.gcr.io/e2e-test-images/agnhost:2.36
27+
imagePullPolicy: IfNotPresent
28+
name: agnhost-container
29+
----
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="configuring-pods-static-ip_{context}"]
7+
= Configuring pods with a static IP address
8+
9+
The following example provisions a pod with a static IP address.
10+
11+
[NOTE]
12+
====
13+
* You can only specify the IP address for a pod's secondary network attachment for layer 2 attachments.
14+
* Specifying a static IP address for the pod is only possible when the attachment configuration does not feature subnets.
15+
====
16+
17+
[source,yaml]
18+
----
19+
apiVersion: v1
20+
kind: Pod
21+
metadata:
22+
annotations:
23+
k8s.v1.cni.cncf.io/networks: '[
24+
{
25+
"name": "l2-network", <1>
26+
"mac": "02:03:04:05:06:07", <2>
27+
"interface": "myiface1", <3>
28+
"ips": [
29+
"192.0.2.20/24"
30+
] <4>
31+
}
32+
]'
33+
name: tinypod
34+
namespace: ns1
35+
spec:
36+
containers:
37+
- args:
38+
- pause
39+
image: k8s.gcr.io/e2e-test-images/agnhost:2.36
40+
imagePullPolicy: IfNotPresent
41+
name: agnhost-container
42+
----
43+
<1> The name of the network. This value must be unique across all `NetworkAttachmentDefinitions`.
44+
<2> The MAC address to be assigned for the interface.
45+
<3> The name of the network interface to be created for the pod.
46+
<4> The IP addresses to be assigned to the network interface.

networking/multiple_networks/configuring-additional-network.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ As a cluster administrator, you can configure an additional network for your clu
1212
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#nw-multus-host-device-object_configuring-additional-network[Host device]
1313
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#nw-multus-ipvlan-object_configuring-additional-network[IPVLAN]
1414
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#nw-multus-macvlan-object_configuring-additional-network[MACVLAN]
15+
* xref:../../networking/multiple_networks/configuring-additional-network.adoc#configuration-ovnk-additional-networks_configuring-additional-network[OVN-Kubernetes]
1516
1617
[id="{context}_approaches-managing-additional-network"]
1718
== Approaches to managing an additional network
@@ -128,6 +129,13 @@ include::modules/nw-multus-bridge-object.adoc[leveloffset=+2]
128129
include::modules/nw-multus-host-device-object.adoc[leveloffset=+2]
129130
include::modules/nw-multus-ipvlan-object.adoc[leveloffset=+2]
130131
include::modules/nw-multus-macvlan-object.adoc[leveloffset=+2]
132+
include::modules/configuring-ovnk-additional-networks.adoc[leveloffset=+2]
133+
include::modules/configuration-ovnk-network-plugin-json-object.adoc[leveloffset=+3]
134+
//include::modules/configuring-layer-three-routed-topology.adoc[leveloffset=+3]
135+
include::modules/configuring-layer-two-switched-topology.adoc[leveloffset=+3]
136+
//include::modules/configuring-localnet-switched-topology.adoc[leveloffset=+3]
137+
include::modules/configuring-pods-secondary-network.adoc[leveloffset=+3]
138+
include::modules/configuring-pods-static-ip.adoc[leveloffset=+3]
131139

132140
include::modules/nw-multus-ipam-object.adoc[leveloffset=+1]
133141

0 commit comments

Comments
 (0)