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
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:
10
10
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
13
15
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.
18
19
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.
20
23
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
+
|
33
27
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`.
36
31
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.
39
35
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`.
42
39
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`.
73
43
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.
78
47
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`.
81
51
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`.
86
55
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`.
91
59
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.
95
63
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.
98
67
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
+
|====
104
69
105
70
[id="nw-multus-bridge-config-example_{context}"]
106
71
== bridge configuration example
107
72
108
73
The following example configures an additional network named `bridge-net`:
109
74
110
-
[source,yaml]
75
+
[source,json]
111
76
----
112
-
name: bridge-net
113
-
namespace: work-network
114
-
type: Raw
115
-
rawCNIConfig: '{ <1>
77
+
{
116
78
"cniVersion": "0.3.1",
117
79
"name": "work-network",
118
80
"type": "bridge",
@@ -121,6 +83,5 @@ rawCNIConfig: '{ <1>
121
83
"ipam": {
122
84
"type": "dhcp"
123
85
}
124
-
}'
86
+
}
125
87
----
126
-
<1> The CNI configuration object is specified as a YAML string.
0 commit comments