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/nw-multus-add-pod.adoc
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ endif::sriov[]
60
60
61
61
. Add an annotation to the `Pod` object. Only one of the following annotation formats can be used:
62
62
+
63
-
.. To attach a secondary network without any customization, add an annotation with the following format. Replace `<network>` with the name of the secondary network to associate with the pod:
63
+
.. To attach a secondary network without any customization, add an annotation with the following format:
64
64
+
65
65
[source,yaml]
66
66
----
@@ -71,7 +71,7 @@ metadata:
71
71
+
72
72
where:
73
73
+
74
-
`k8s.v1.cni.cncf.io/networks`:: To specify more than one secondary network, separate each network with a comma. Do not include whitespace between the comma. If you specify the same secondary network multiple times, that pod will have multiple network interfaces attached to that network.
74
+
`k8s.v1.cni.cncf.io/networks`:: Specifies the name of the secondary network to associate with the pod. To specify more than one secondary network, separate each network with a comma. Do not include whitespace between the comma. If you specify the same secondary network multiple times, that pod will have multiple network interfaces attached to that network.
75
75
+
76
76
.. To attach a secondary network with customizations, add an annotation with the following format:
77
77
+
@@ -91,18 +91,20 @@ metadata:
91
91
+
92
92
where:
93
93
+
94
-
`name`:: Specify the name of the secondary network defined by a `NetworkAttachmentDefinition` object.
95
-
`namespace`:: Specify the namespace where the `NetworkAttachmentDefinition` object is defined.
96
-
`default-route`:: Optional parameter. Specify an override for the default route, such as `192.168.17.1`.
94
+
`name`:: Specifies the name of the secondary network defined by a `NetworkAttachmentDefinition` object.
95
+
`namespace`:: Specifies the namespace where the `NetworkAttachmentDefinition` object is defined.
96
+
`default-route`:: Optional parameter. Specifies an override for the default route, such as `192.168.17.1`.
97
97
98
-
. To create the pod, enter the following command. Replace `<name>` with the name of the pod.
98
+
. Create the pod by entering the following command.
99
99
+
100
100
[source,terminal]
101
101
----
102
102
$ oc create -f <name>.yaml
103
103
----
104
+
+
105
+
Replace `<name>` with the name of the pod.
104
106
105
-
. Optional: To Confirm that the annotation exists in the `Pod` CR, enter the following command, replacing `<name>` with the name of the pod.
107
+
. Optional: Confirm that the annotation exists in the `pod` CR by entering the following command. Replace `<name>` with the name of the pod.
106
108
+
107
109
[source,terminal]
108
110
----
@@ -148,7 +150,7 @@ status:
148
150
+
149
151
where:
150
152
+
151
-
`k8s.v1.cni.cncf.io/network-status`:: The `k8s.v1.cni.cncf.io/network-status` parameter is a JSON array of
153
+
`k8s.v1.cni.cncf.io/network-status`:: Specifies a JSON array of
152
154
objects. Each object describes the status of a secondary network attached
153
155
to the pod. The annotation value is stored as a plain text value.
Copy file name to clipboardExpand all lines: modules/nw-multus-advanced-annotations.adoc
+33-36Lines changed: 33 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@
6
6
[id="nw-multus-advanced-annotations_{context}"]
7
7
= Specifying pod-specific addressing and routing options
8
8
9
-
When attaching a pod to an additional network, you may want to specify further properties
10
-
about that network in a particular pod. This allows you to change some aspects of routing, as well
11
-
as specify static IP addresses and MAC addresses. To accomplish this, you can use the JSON formatted annotations.
9
+
[role="_abstract"]
10
+
You can configure pod-specific addressing and routing options by using JSON-formatted annotations.
11
+
Configuring these options enables you to set static IP addresses, MAC addresses, and default routes for the pod.
12
12
13
13
.Prerequisites
14
14
@@ -21,8 +21,6 @@ endif::sriov[]
21
21
22
22
.Procedure
23
23
24
-
To add a pod to an additional network while specifying addressing and/or routing options, complete the following steps:
25
-
26
24
. Edit the `Pod` resource definition. If you are editing an existing `Pod` resource, run the
27
25
following command to edit its definition in the default editor. Replace `<name>`
28
26
with the name of the `Pod` resource to edit.
@@ -65,8 +63,8 @@ metadata:
65
63
"name": "net1"
66
64
},
67
65
{
68
-
"name": "net2", <1>
69
-
"default-route": ["192.0.2.1"] <2>
66
+
"name": "net2",
67
+
"default-route": ["192.0.2.1"]
70
68
}]'
71
69
spec:
72
70
containers:
@@ -78,9 +76,9 @@ spec:
78
76
--
79
77
where:
80
78
81
-
`name`:: The `name` key is the name of the secondary network to associate
79
+
`name`:: Specifies the name of the secondary network to associate
82
80
with the pod.
83
-
`default-route`:: The `default-route` key specifies a value of a gateway for traffic to be routed over if no other routing entry is present in the routing table. If more than one `default-route` key is specified, this will cause the pod to fail to become active.
81
+
`default-route`:: Specifies a value of a gateway for traffic to be routed over if no other routing entry is present in the routing table. If more than one `default-route` key is specified, this will cause the pod to fail to become active.
84
82
--
85
83
+
86
84
The default route will cause any traffic that is not specified in other routes to be routed to the gateway.
@@ -118,9 +116,9 @@ The following YAML describes the configuration parameters for the CNO:
118
116
.Cluster Network Operator YAML configuration
119
117
[source,yaml]
120
118
----
121
-
name: <name> <1>
122
-
namespace: <namespace> <2>
123
-
rawCNIConfig: '{ <3>
119
+
name: <name>
120
+
namespace: <namespace>
121
+
rawCNIConfig: '{
124
122
...
125
123
}'
126
124
type: Raw
@@ -129,9 +127,9 @@ type: Raw
129
127
--
130
128
where:
131
129
132
-
`name`:: Specify a name for the secondary network attachment that you are creating. The name must be unique within the specified `namespace`.
133
-
`namespace`:: Specify the namespace to create the network attachment in. If you do not specify a value, then the `default` namespace is used.
134
-
`rawCNIConfig`:: Specify the CNI plugin configuration in JSON format, which is based on the following template.
130
+
`name`:: Specifies a name for the secondary network attachment that you are creating. The name must be unique within the specified `namespace`.
131
+
`namespace`:: Specifies the namespace to create the network attachment in. If you do not specify a value, then the `default` namespace is used.
132
+
`rawCNIConfig`:: Specifies the CNI plugin configuration in JSON format, which is based on the following template.
135
133
--
136
134
+
137
135
The following object describes the configuration parameters for utilizing static MAC address and IP address using the macvlan CNI plugin:
@@ -141,17 +139,17 @@ The following object describes the configuration parameters for utilizing static
141
139
----
142
140
{
143
141
"cniVersion": "0.3.1",
144
-
"name": "<name>", <1>
145
-
"plugins": [{ <2>
142
+
"name": "<name>",
143
+
"plugins": [{
146
144
"type": "macvlan",
147
-
"capabilities": { "ips": true }, <3>
148
-
"master": "eth0", <4>
145
+
"capabilities": { "ips": true },
146
+
"master": "eth0",
149
147
"mode": "bridge",
150
148
"ipam": {
151
149
"type": "static"
152
150
}
153
151
}, {
154
-
"capabilities": { "mac": true }, <5>
152
+
"capabilities": { "mac": true },
155
153
"type": "tuning"
156
154
}]
157
155
}
@@ -168,8 +166,9 @@ where:
168
166
--
169
167
+
170
168
The above network attachment can be referenced in a JSON formatted annotation, along with keys to specify which static IP and MAC address will be assigned to a given pod.
171
-
+
172
-
Edit the pod with:
169
+
170
+
171
+
. Edit the pod by entering the following command:
173
172
+
174
173
[source,terminal]
175
174
----
@@ -187,24 +186,22 @@ metadata:
187
186
annotations:
188
187
k8s.v1.cni.cncf.io/networks: '[
189
188
{
190
-
"name": "<name>", <1>
191
-
"ips": [ "192.0.2.205/24" ], <2>
192
-
"mac": "CA:FE:C0:FF:EE:00" <3>
189
+
"name": "<name>",
190
+
"ips": [ "192.0.2.205/24" ],
191
+
"mac": "CA:FE:C0:FF:EE:00"
193
192
}
194
193
]'
195
194
----
196
-
<1> Use the `<name>` as provided when creating the `rawCNIConfig` above.
197
-
<2> Provide an IP address including the subnet mask.
198
-
<3> Provide the MAC address.
195
+
+
196
+
--
197
+
where:
198
+
199
+
`name`:: Specifies the name for the secondary network attachment to create. The name must be unique within the specified `namespace`.
200
+
`ips`:: Specifies an IP address including the subnet mask.
201
+
`mac`:: Specifies the MAC address.
202
+
--
199
203
+
200
204
[NOTE]
201
205
====
202
-
Static IP addresses and MAC addresses do not have to be used at the same time, you may use them individually, or together.
206
+
Static IP addresses and MAC addresses do not have to be used at the same time. You can use them individually, or together.
203
207
====
204
-
+
205
-
. To verify the IP address and MAC properties of a pod with secondary networks, use the `oc` command to execute the ip command within a pod.
Copy file name to clipboardExpand all lines: modules/nw-multus-delete-network.adoc
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,8 @@
6
6
[id="nw-multus-delete-network_{context}"]
7
7
= Removing an additional network attachment definition
8
8
9
-
As a cluster administrator, you can remove an additional network from your
10
-
{product-title} cluster. The additional network is not removed from any pods it
11
-
is attached to.
9
+
[role="_abstract"]
10
+
As a cluster administrator, you can remove a secondary network from your {product-title} cluster. The secondary network is not removed from any pods that it is attached to.
12
11
13
12
.Prerequisites
14
13
@@ -17,10 +16,7 @@ is attached to.
17
16
18
17
.Procedure
19
18
20
-
To remove an additional network from your cluster, complete the following steps:
21
-
22
-
. Edit the Cluster Network Operator (CNO) in your default text editor by running
23
-
the following command:
19
+
. Edit the Cluster Network Operator (CNO) in your default text editor by running the following command:
24
20
+
25
21
[source,terminal]
26
22
----
@@ -37,11 +33,23 @@ kind: Network
37
33
metadata:
38
34
name: cluster
39
35
spec:
40
-
additionalNetworks: [] <1>
36
+
additionalNetworks: []
41
37
----
42
-
<1> If you are removing the configuration mapping for the only additional
43
-
network attachment definition in the `additionalNetworks` collection, you must
44
-
specify an empty collection.
38
+
+
39
+
--
40
+
where:
41
+
42
+
`additionalNetworks`:: Specifies the secondary network attachment definition that you want to remove from the `additionalNetworks` collection. If you are removing the configuration mapping for the only secondary network attachment definition in the `additionalNetworks` collection, you must specify an empty collection.
43
+
--
44
+
45
+
. Remove a network attachment definition from the network of your cluster by entering the following command:
Copy file name to clipboardExpand all lines: modules/nw-multus-edit-network.adoc
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@
6
6
[id="nw-multus-edit-network_{context}"]
7
7
= Modifying an additional network attachment definition
8
8
9
-
As a cluster administrator, you can make changes to an existing additional
10
-
network. Any existing pods attached to the additional network will not be updated.
9
+
[role="_abstract"]
10
+
You can modify a secondary network attachment definition.
11
+
You modify the attachment definition to update network settings or change network parameters.
11
12
12
13
.Prerequisites
13
14
@@ -17,26 +18,22 @@ network. Any existing pods attached to the additional network will not be update
17
18
18
19
.Procedure
19
20
20
-
To edit an additional network for your cluster, complete the following steps:
21
-
22
-
. Run the following command to edit the Cluster Network Operator (CNO) CR in
23
-
your default text editor:
21
+
. Edit the Cluster Network Operator (CNO) CR in your default text editor by running the following command:
24
22
+
25
23
[source,terminal]
26
24
----
27
25
$ oc edit networks.operator.openshift.io cluster
28
26
----
29
27
30
-
. In the `additionalNetworks` collection, update the additional network with
31
-
your changes.
28
+
. In the `additionalNetworks` collection, update the secondary network with your changes.
32
29
33
30
. Save your changes and quit the text editor to commit your changes.
34
31
35
-
. Optional: Confirm that the CNO updated the `NetworkAttachmentDefinition` object by running the following command. Replace `<network-name>` with the name of the additional network to display. There might be a delay before the CNO updates the `NetworkAttachmentDefinition` object to reflect your changes.
32
+
. Optional: Confirm that the CNO updated the `NetworkAttachmentDefinition` object by running the following command. Replace `<network_name>` with the name of the secondary network to display. There might be a delay before the CNO updates the `NetworkAttachmentDefinition` object to reflect your changes.
36
33
+
37
34
[source,terminal]
38
35
----
39
-
$ oc get network-attachment-definitions <network-name> -o yaml
36
+
$ oc get network-attachment-definitions <network_name> -o yaml
40
37
----
41
38
+
42
39
For example, the following console output displays a `NetworkAttachmentDefinition` object that is named `net1`:
0 commit comments