Skip to content

Commit c8bbeb6

Browse files
authored
Merge pull request #74823 from ShaunaDiaz/OSDOCS-9426
OSDOCS-9426: add supported CNIs multus MicroShift
2 parents ade6855 + aca8199 commit c8bbeb6

File tree

5 files changed

+124
-22
lines changed

5 files changed

+124
-22
lines changed

microshift_networking/microshift_multiple_networks/microshift-cni-multus.adoc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@ include::_attributes/attributes-microshift.adoc[]
66

77
toc::[]
88

9-
In addition to the default OVN-Kubernetes Container Network Interface (CNI) plugin, {microshift-short} uses the Multus CNI to chain other CNI plugins.
9+
In addition to the default OVN-Kubernetes Container Network Interface (CNI) plugin, {microshift-short} uses an implementation of the Multus CNI to chain other CNI plugins.
1010

1111
include::modules/microshift-multus-intro.adoc[leveloffset=+1]
1212

13-
//TODO: add more detail on supported plugins
14-
1513
include::modules/microshift-install-multus-running-cluster.adoc[leveloffset=+1]
14+
15+
//OCP module, edit with conditionals and care
16+
include::modules/nw-multus-bridge-object.adoc[leveloffset=+1]
17+
//Q: do we need to remove VLAN from this reference for microshift?
18+
19+
//OCP module, edit with conditionals and care
20+
include::modules/nw-multus-ipvlan-object.adoc[leveloffset=+1]
21+
22+
//OCP module, edit with conditionals and care
23+
include::modules/nw-multus-macvlan-object.adoc[leveloffset=+1]
24+
25+
[role="_additional-resources"]
26+
.Additional resources
27+
28+
//* add cross refs to procedures

modules/microshift-multus-intro.adoc

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,60 @@
66
[id="microshift-multus-intro_{context}"]
77
= Additional networks in {microshift-short}
88

9-
During cluster installation, the _default_ pod network is configured with default values unless you customize the configuration. The default network handles all ordinary network traffic for the cluster. Using the Multus CNI plugin, you can add additional interfaces to pods from other networks. This gives you flexibility when you configure pods that deliver network functionality, such as switching or routing.
9+
During cluster installation, the _default_ pod network is configured with default values unless you customize the configuration. The default network handles all ordinary network traffic for the cluster. Using the {microshift-short} Multus CNI plugin, you can add additional interfaces to pods from other networks. This gives you flexibility when you configure pods that deliver network functionality, such as switching or routing.
1010

11-
[id="additional-network-use-cases"]
11+
[id="microshift-supported-additional-networks_{context}"]
12+
== Supported additional networks for network isolation
13+
The following additional networks are supported in {microshift-short} {product-version}:
14+
15+
* Bridge: Allows pods on the same host to communicate with each other and the host.
16+
17+
* IPVLAN: Allows pods on a host to communicate with other hosts.
18+
** This is similar to a MACVLAN-based additional network.
19+
** Each pod shares the same MAC address as the parent physical network interface, unlike a MACVLAN-based additional network.
20+
21+
* MACVLAN: Allows pods on a host to communicate with other hosts and the pods on those other hosts by using a physical network interface. Each pod that is attached to a MACVLAN-based additional network is provided with a unique MAC address.
22+
23+
[NOTE]
24+
====
25+
Setting network policies for additional networks is not supported.
26+
====
27+
28+
[id="microshift-additional-network-use-cases_{context}"]
1229
== Use case: Additional networks for network isolation
1330

14-
You can use an additional network in situations where network isolation is needed, including control plane and data plane separation. You can create additional interfaces for pods to connect to that network in addition to a default. For example, you can configure an additional interface if you want pods to access a network on the host and also communicate with devices deployed to the edge that are on an isolated operator network or are periodically disconnected.
31+
You can use an additional network in situations where network isolation is needed, including control plane and data plane separation. You can create additional interfaces for pods to connect to that network in addition to a default. For example, you can configure an additional interface if you want pods to access a network on the host and also communicate with devices deployed to the edge. These edge devices might be on an isolated operator network or are periodically disconnected.
1532

1633
Isolating network traffic is useful for the following performance and security reasons:
1734

1835
Performance:: You can send traffic on two different planes to manage the amount of traffic on each plane.
1936
Security:: You can send sensitive traffic onto a network plane that is managed specifically for security considerations, and you can separate private data that must not be shared between tenants or customers.
2037

21-
[id="additional-network-how-implemented"]
38+
[IMPORTANT]
39+
====
40+
The Multus CNI plugin is deployed when the {microshift-short} service starts up. Therefore, a host restart is required if the `microshift-multus` RPM package is added after {microshift-short} has started. Restarting ensures that all containers are re-created with Multus annotations.
41+
====
42+
43+
[id="microshift-additional-network-how-implemented_{context}"]
2244
== How additional networks are implemented
2345

24-
All of the pods in the cluster still use the cluster-wide default network to maintain connectivity across the cluster. Every pod has an `eth0` interface that is attached to the cluster-wide pod network. You can view the interfaces for a pod by using the `oc exec -it <pod_name> \-- ip a` command. If you add additional network interfaces that use Multus CNI, they are named `net1`, `net2`, ..., `netN`.
46+
All of the pods in the cluster still use the cluster-wide default network to maintain connectivity across the cluster. Every pod has an `eth0` interface that is attached to the cluster-wide pod network.
47+
48+
* You can view the interfaces for a pod by using the `oc get pod <pod_name> -o=jsonpath='{ .metadata.annotations.k8s\.v1\.cni\.cncf\.io/network-status }'` command.
49+
* If you add additional network interfaces that use the {microshift-short} Multus CNI, they are named `net1`, `net2`, ..., `netN`.
50+
* The CNI configuration is created when the {microshift-short} Multus DaemonSet starts. This configuration is autogenerated and includes the primary CNI that is the default delegate. For {microshift-short}, the default CNI is OVN-Kubernetes.
51+
52+
[id="microshift-additional-network-how-attached-pods_{context}"]
53+
== How to attached additional networks to pods
54+
55+
To attach additional network interfaces to a pod, you must create and apply configurations that define how the interfaces are attached.
56+
57+
* You must configure any additional networks you want to use. Because of individual differences in networks, no default configuration is provided.
58+
* You must apply YAML manifest to specify each interface by using a `NetworkAttachmentDefinition` custom resource (CR). A configuration inside each of these CRs defines how that interface is created.
59+
* CRI-O must be configured to use Multus. A default configuration is included in the `microshift-multus` RPM.
60+
** If the Multus CNI is installed on an existing {microshift-short} instance, the host must be restarted.
61+
** If the Multus CNI is installed alongside {microshift-short}, you can add CRs and pods and then start the {microshift-short} service. Restarting the host in this scenario is not needed.
2562

26-
To attach additional network interfaces to a pod, you must create configurations that define how the interfaces are attached. You specify each interface by using a `NetworkAttachmentDefinition` custom resource (CR). A configuration inside each of these CRs defines how that interface is created.
63+
[id="microshift-config-examples-additional-networks_{context}"]
64+
== Configurations for additional network types
65+
The specific configuration fields for additional networks is described in the following sections.

modules/nw-multus-bridge-object.adoc

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
// Module included in the following assemblies:
22
//
33
// * networking/multiple_networks/configuring-additional-network.adoc
4+
// * microshift_networking/microshift_multiple_networks/microshift_cni_multus.adoc
5+
46
:_mod-docs-content-type: REFERENCE
57
[id="nw-multus-bridge-object_{context}"]
68
= Configuration for a bridge additional network
79

8-
The following object describes the configuration parameters for the bridge CNI
9-
plugin:
10+
The following object describes the configuration parameters for the Bridge CNI plugin:
1011

1112
.Bridge CNI plugin JSON configuration object
1213
[cols=".^2,.^2,.^6",options="header"]
1314
|====
1415
|Field|Type|Description
1516

17+
ifndef::microshift[]
1618
|`cniVersion`
1719
|`string`
1820
|The CNI specification version. The `0.3.1` value is required.
1921

2022
|`name`
2123
|`string`
2224
|The value for the `name` parameter you provided previously for the CNO configuration.
25+
endif::microshift[]
26+
27+
ifdef::microshift[]
28+
|`cniVersion`
29+
|`string`
30+
|The CNI specification version. The `0.4.0` value is required.
31+
endif::microshift[]
2332

2433
|`type`
2534
|`string`
@@ -57,6 +66,7 @@ plugin:
5766
|`boolean`
5867
|Optional: Set to `true` to enable promiscuous mode on the bridge. The default value is `false`.
5968

69+
ifndef::microshift[]
6070
|`vlan`
6171
|`string`
6272
|Optional: Specify a virtual LAN (VLAN) tag as an integer value. By default, no VLAN tag is assigned.
@@ -68,6 +78,7 @@ plugin:
6878
|`vlanTrunk`
6979
|`list`
7080
|Optional: Assign a VLAN trunk tag. The default value is `none`.
81+
endif::microshift[]
7182

7283
|`mtu`
7384
|`string`
@@ -82,25 +93,24 @@ plugin:
8293
|Optional: Enables mac spoof check, limiting the traffic originating from the container to the mac address of the interface. The default value is `false`.
8394
|====
8495

96+
ifndef::microshift[]
8597
[NOTE]
8698
====
8799
The VLAN parameter configures the VLAN tag on the host end of the `veth` and also enables the `vlan_filtering` feature on the bridge interface.
88100
====
89101

90102
[NOTE]
91103
====
92-
To configure uplink for a L2 network you need to allow the vlan on the uplink interface by using the following command:
104+
To configure an uplink for an L2 network, you must allow the VLAN on the uplink interface by using the following command:
93105
94106
[source,terminal]
95107
----
96108
$ bridge vlan add vid VLAN_ID dev DEV
97109
----
98-
99110
====
100111

101-
102112
[id="nw-multus-bridge-config-example_{context}"]
103-
== bridge configuration example
113+
== Bridge CNI plugin configuration example
104114

105115
The following example configures an additional network named `bridge-net`:
106116

@@ -117,3 +127,40 @@ The following example configures an additional network named `bridge-net`:
117127
}
118128
}
119129
----
130+
endif::microshift[]
131+
132+
ifdef::microshift[]
133+
[id="microshift-nw-multus-bridge-config-example_{context}"]
134+
== Bridge CNI plugin configuration example
135+
136+
The following example configures an additional network named `bridge-conf` for use with the {microshift-short} Multus CNI:
137+
138+
[source,json]
139+
----
140+
apiVersion: "k8s.cni.cncf.io/v1"
141+
kind: NetworkAttachmentDefinition
142+
metadata:
143+
name: bridge-conf
144+
spec:
145+
config: '{
146+
"cniVersion": "0.4.0",
147+
"type": "bridge",
148+
"bridge": "test-bridge",
149+
"mode": "bridge",
150+
"ipam": {
151+
"type": "host-local",
152+
"ranges": [
153+
[
154+
{
155+
"subnet": "10.10.0.0/16",
156+
"rangeStart": "10.10.1.20",
157+
"rangeEnd": "10.10.3.50",
158+
"gateway": "10.10.0.254"
159+
}
160+
]
161+
],
162+
"dataDir": "/var/lib/cni/test-bridge"
163+
}
164+
}'
165+
----
166+
endif::microshift[]

modules/nw-multus-ipvlan-object.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// Module included in the following assemblies:
22
//
33
// * networking/multiple_networks/configuring-additional-network.adoc
4+
// * microshift_networking/microshift_multiple_networks/microshift_cni_multus.adoc
45

56
//37.1. IPVLAN overview
67
// https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/getting-started-with-ipvlan_configuring-and-managing-networking#ipvlan-overview_getting-started-with-ipvlan
78
:_mod-docs-content-type: REFERENCE
89

910
[id="nw-multus-ipvlan-object_{context}"]
10-
= Configuration for an IPVLAN additional network
11+
= Configuration for an ipvlan additional network
1112

1213
The following object describes the configuration parameters for the IPVLAN CNI plugin:
1314

@@ -50,15 +51,15 @@ The following object describes the configuration parameters for the IPVLAN CNI p
5051

5152
|====
5253

53-
[NOTE]
54+
[IMPORTANT]
5455
====
55-
* The `ipvlan` object does not allow virtual interfaces to communicate with the `master` interface. Therefore the container will not be able to reach the host by using the `ipvlan` interface. Be sure that the container joins a network that provides connectivity to the host, such as a network supporting the Precision Time Protocol (`PTP`).
56+
* The `ipvlan` object does not allow virtual interfaces to communicate with the `master` interface. Therefore the container is not able to reach the host by using the `ipvlan` interface. Be sure that the container joins a network that provides connectivity to the host, such as a network supporting the Precision Time Protocol (`PTP`).
5657
* A single `master` interface cannot simultaneously be configured to use both `macvlan` and `ipvlan`.
5758
* For IP allocation schemes that cannot be interface agnostic, the `ipvlan` plugin can be chained with an earlier plugin that handles this logic. If the `master` is omitted, then the previous result must contain a single interface name for the `ipvlan` plugin to enslave. If `ipam` is omitted, then the previous result is used to configure the `ipvlan` interface.
5859
====
5960

6061
[id="nw-multus-ipvlan-config-example_{context}"]
61-
== ipvlan configuration example
62+
== IPVLAN CNI plugin configuration example
6263

6364
The following example configures an additional network named `ipvlan-net`:
6465

modules/nw-multus-macvlan-object.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Module included in the following assemblies:
22
//
33
// * networking/multiple_networks/configuring-additional-network.adoc
4+
// * microshift_networking/microshift_multiple_networks/microshift_cni_multus.adoc
5+
46
:_mod-docs-content-type: REFERENCE
57
[id="nw-multus-macvlan-object_{context}"]
6-
= Configuration for a MACVLAN additional network
8+
= Configuration for a macvlan additional network
79

8-
The following object describes the configuration parameters for the macvlan CNI plugin:
10+
The following object describes the configuration parameters for the MACVLAN CNI plugin:
911

1012
.MACVLAN CNI plugin JSON configuration object
1113
[cols=".^2,.^2,.^6",options="header"]
@@ -52,7 +54,7 @@ If you specify the `master` key for the plugin configuration, use a different ph
5254
====
5355

5456
[id="nw-multus-macvlan-config-example_{context}"]
55-
== macvlan configuration example
57+
== MACVLAN CNI plugin configuration example
5658

5759
The following example configures an additional network named `macvlan-net`:
5860

0 commit comments

Comments
 (0)