Skip to content

Commit 5f1abab

Browse files
authored
Merge pull request #38235 from jboxman-rh/favour-tables-multus-cnis
Reorganize Multus related CNI plug-in content
2 parents e5dfcc0 + 785fb6f commit 5f1abab

16 files changed

+494
-925
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,8 @@ Topics:
931931
Topics:
932932
- Name: Understanding multiple networks
933933
File: understanding-multiple-networks
934+
- Name: Configuring an additional network
935+
File: configuring-additional-network
934936
- Name: About virtual routing and forwarding
935937
File: about-virtual-routing-and-forwarding
936938
- Name: Configuring multi-network policy
@@ -939,16 +941,6 @@ Topics:
939941
File: attaching-pod
940942
- Name: Removing a pod from an additional network
941943
File: removing-pod
942-
- Name: Configuring a bridge network
943-
File: configuring-bridge
944-
- Name: Configuring a host-device network
945-
File: configuring-host-device
946-
- Name: Configuring an ipvlan network
947-
File: configuring-ipvlan
948-
- Name: Configuring a macvlan network with basic customizations
949-
File: configuring-macvlan-basic
950-
- Name: Configuring a macvlan network
951-
File: configuring-macvlan
952944
- Name: Editing an additional network
953945
File: edit-additional-network
954946
- Name: Removing an additional network

modules/nw-multus-bridge-object.adoc

Lines changed: 51 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,80 @@
11
// Module included in the following assemblies:
22
//
3-
// * networking/multiple_networks/configuring-bridge.adoc
3+
// * networking/multiple_networks/configuring-additional-network.adoc
44

55
[id="nw-multus-bridge-object_{context}"]
6-
= Configuration for bridge
6+
= Configuration for a bridge additional network
77

8-
The configuration for an additional network attachment that uses the bridge
9-
Container Network Interface (CNI) plug-in is provided in two parts:
8+
The following object describes the configuration parameters for the bridge CNI
9+
plug-in:
1010

11-
* Cluster Network Operator (CNO) configuration
12-
* CNI plug-in configuration
11+
.Bridge CNI plug-in JSON configuration object
12+
[cols=".^2,.^2,.^6",options="header"]
13+
|====
14+
|Field|Type|Description
1315

14-
The CNO configuration specifies the name for the additional network attachment
15-
and the namespace to create the attachment in. The plug-in
16-
is configured by a JSON object specified by the `rawCNIConfig` parameter in
17-
the CNO configuration.
16+
|`cniVersion`
17+
|`string`
18+
|The CNI specification version. The `0.3.1` value is required.
1819

19-
The following YAML describes the configuration parameters for the CNO:
20+
|`name`
21+
|`string`
22+
|The value for the `name` parameter you provided previously for the CNO configuration.
2023

21-
.Cluster Network Operator YAML configuration
22-
[source,yaml]
23-
----
24-
name: <name> <1>
25-
namespace: <namespace> <2>
26-
rawCNIConfig: '{ <3>
27-
...
28-
}'
29-
type: Raw
30-
----
31-
<1> Specify a name for the additional network attachment that you are
32-
creating. The name must be unique within the specified `namespace`.
24+
|`type`
25+
|`string`
26+
|
3327

34-
<2> Specify the namespace to create the network attachment in. If
35-
you do not specify a value, then the `default` namespace is used.
28+
|`bridge`
29+
|`string`
30+
|Specify the name of the virtual bridge to use. If the bridge interface does not exist on the host, it is created. The default value is `cni0`.
3631

37-
<3> Specify the CNI plug-in configuration in JSON format, which
38-
is based on the following template.
32+
|`ipam`
33+
|`object`
34+
|The configuration object for the ipam CNI plug-in. The plug-in manages IP address assignment for the attachment definition.
3935

40-
The following object describes the configuration parameters for the bridge CNI
41-
plug-in:
36+
|`ipMasq`
37+
|`boolean`
38+
|Set to `true` to enable IP masquerading for traffic that leaves the virtual network. The source IP address for all traffic is rewritten to the bridge's IP address. If the bridge does not have an IP address, this setting has no effect. The default value is `false`.
4239

43-
.bridge CNI plug-in JSON configuration object
44-
[source,json]
45-
----
46-
{
47-
"cniVersion": "0.3.1",
48-
"name": "<name>", <1>
49-
"type": "bridge",
50-
"bridge": "<bridge>", <2>
51-
"ipam": { <3>
52-
...
53-
},
54-
"ipMasq": false, <4>
55-
"isGateway": false, <5>
56-
"isDefaultGateway": false, <6>
57-
"forceAddress": false, <7>
58-
"hairpinMode": false, <8>
59-
"promiscMode": false, <9>
60-
"vlan": <vlan>, <10>
61-
"mtu": <mtu> <11>
62-
}
63-
----
64-
<1> Specify the value for the `name` parameter you provided previously for
65-
the CNO configuration.
66-
67-
<2> Specify the name of the virtual bridge to use. If the bridge
68-
interface does not exist on the host, it is created. The default value is
69-
`cni0`.
70-
71-
<3> Specify a configuration object for the ipam CNI plug-in. The plug-in
72-
manages IP address assignment for the network attachment definition.
40+
|`isGateway`
41+
|`boolean`
42+
|Set to `true` to assign an IP address to the bridge. The default value is `false`.
7343

74-
<4> Set to `true` to enable IP masquerading for traffic that leaves the
75-
virtual network. The source IP address for all traffic is rewritten to the
76-
bridge's IP address. If the bridge does not have an IP address, this setting has
77-
no effect. The default value is `false`.
44+
|`isDefaultGateway`
45+
|`boolean`
46+
|Set to `true` to configure the bridge as the default gateway for the virtual network. The default value is `false`. If `isDefaultGateway` is set to `true`, then `isGateway` is also set to `true` automatically.
7847

79-
<5> Set to `true` to assign an IP address to the bridge. The
80-
default value is `false`.
48+
|`forceAddress`
49+
|`boolean`
50+
|Set to `true` to allow assignment of a previously assigned IP address to the virtual bridge. When set to `false`, if an IPv4 address or an IPv6 address from overlapping subsets is assigned to the virtual bridge, an error occurs. The default value is `false`.
8151

82-
<6> Set to `true` to configure the bridge as the default
83-
gateway for the virtual network. The default value is `false`. If
84-
`isDefaultGateway` is set to `true`, then `isGateway` is also set to `true`
85-
automatically.
52+
|`hairpinMode`
53+
|`boolean`
54+
|Set to `true` to allow the virtual bridge to send an ethernet frame back through the virtual port it was received on. This mode is also known as _reflective relay_. The default value is `false`.
8655

87-
<7> Set to `true` to allow assignment of a previously assigned
88-
IP address to the virtual bridge. When set to `false`, if an IPv4 address or an
89-
IPv6 address from overlapping subsets is assigned to the virtual bridge, an
90-
error occurs. The default value is `false`.
56+
|`promiscMode`
57+
|`boolean`
58+
|Set to `true` to enable promiscuous mode on the bridge. The default value is `false`.
9159

92-
<8> Set to `true` to allow the virtual bridge to send an ethernet
93-
frame back through the virtual port it was received on. This mode is also known
94-
as _reflective relay_. The default value is `false`.
60+
|`vlan`
61+
|`string`
62+
|Specify a virtual LAN (VLAN) tag as an integer value. By default, no VLAN tag is assigned.
9563

96-
<9> Set to `true` to enable promiscuous mode on the bridge. The
97-
default value is `false`.
64+
|`mtu`
65+
|`string`
66+
|Set the maximum transmission unit (MTU) to the specified value. The default value is automatically set by the kernel.
9867

99-
<10> Specify a virtual LAN (VLAN) tag as an integer value. By default,
100-
no VLAN tag is assigned.
101-
102-
<11> Set the maximum transmission unit (MTU) to the specified value. The
103-
default value is automatically set by the kernel.
68+
|====
10469

10570
[id="nw-multus-bridge-config-example_{context}"]
10671
== bridge configuration example
10772

10873
The following example configures an additional network named `bridge-net`:
10974

110-
[source,yaml]
75+
[source,json]
11176
----
112-
name: bridge-net
113-
namespace: work-network
114-
type: Raw
115-
rawCNIConfig: '{ <1>
77+
{
11678
"cniVersion": "0.3.1",
11779
"name": "work-network",
11880
"type": "bridge",
@@ -121,6 +83,5 @@ rawCNIConfig: '{ <1>
12183
"ipam": {
12284
"type": "dhcp"
12385
}
124-
}'
86+
}
12587
----
126-
<1> The CNI configuration object is specified as a YAML string.
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+
4+
[id="nw-multus-create-network-apply_{context}"]
5+
= Creating an additional network attachment by applying a YAML manifest
6+
7+
.Prerequisites
8+
9+
* Install the OpenShift CLI (`oc`).
10+
* Log in as a user with `cluster-admin` privileges.
11+
12+
.Procedure
13+
14+
. Create a YAML file with your additional network configuration, such as in the following example:
15+
+
16+
[source,yaml]
17+
----
18+
apiVersion: k8s.cni.cncf.io/v1
19+
kind: NetworkAttachmentDefinition
20+
metadata:
21+
name: next-net
22+
spec:
23+
config: |-
24+
{
25+
"cniVersion": "0.3.1",
26+
"name": "work-network",
27+
"type": "host-device",
28+
"device": "eth1",
29+
"ipam": {
30+
"type": "dhcp"
31+
}
32+
}
33+
----
34+
35+
. To create the additional network, enter the following command:
36+
+
37+
[source,terminal]
38+
----
39+
$ oc apply -f <file>.yaml
40+
----
41+
+
42+
--
43+
where:
44+
45+
`<file>`:: Specifies the name of the file contained the YAML manifest.
46+
--

0 commit comments

Comments
 (0)