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
----
@@ -147,7 +149,7 @@ status:
147
149
+
148
150
where:
149
151
+
150
-
`k8s.v1.cni.cncf.io/network-status`:: The `k8s.v1.cni.cncf.io/network-status` parameter is a JSON array of
152
+
`k8s.v1.cni.cncf.io/network-status`:: Specifies a JSON array of
151
153
objects. Each object describes the status of a secondary network attached
152
154
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 a secondary 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 a secondary 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.
@@ -62,8 +60,8 @@ metadata:
62
60
"name": "net1"
63
61
},
64
62
{
65
-
"name": "net2", <1>
66
-
"default-route": ["192.0.2.1"] <2>
63
+
"name": "net2",
64
+
"default-route": ["192.0.2.1"]
67
65
}]'
68
66
spec:
69
67
containers:
@@ -75,9 +73,9 @@ spec:
75
73
--
76
74
where:
77
75
78
-
`name`:: The `name` key is the name of the secondary network to associate
76
+
`name`:: Specifies the name of the secondary network to associate
79
77
with the pod.
80
-
`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.
78
+
`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.
81
79
--
82
80
+
83
81
The default route will cause any traffic that is not specified in other routes to be routed to the gateway.
@@ -115,9 +113,9 @@ The following YAML describes the configuration parameters for the CNO:
115
113
.Cluster Network Operator YAML configuration
116
114
[source,terminal,subs="attributes+"]
117
115
----
118
-
name: <name> <1>
119
-
namespace: <namespace> <2>
120
-
rawCNIConfig: '{ <3>
116
+
name: <name>
117
+
namespace: <namespace>
118
+
rawCNIConfig: '{
121
119
...
122
120
}'
123
121
type: Raw
@@ -126,9 +124,9 @@ type: Raw
126
124
--
127
125
where:
128
126
129
-
`name`:: Specify a name for the secondary network attachment that you are creating. The name must be unique within the specified `namespace`.
130
-
`namespace`:: Specify the namespace to create the network attachment in. If you do not specify a value, then the `default` namespace is used.
131
-
`rawCNIConfig`:: Specify the CNI plugin configuration in JSON format, which is based on the following template.
127
+
`name`:: Specifies a name for the secondary network attachment that you are creating. The name must be unique within the specified `namespace`.
128
+
`namespace`:: Specifies the namespace to create the network attachment in. If you do not specify a value, then the `default` namespace is used.
129
+
`rawCNIConfig`:: Specifies the CNI plugin configuration in JSON format, which is based on the following template.
132
130
--
133
131
+
134
132
The following object describes the configuration parameters for utilizing static MAC address and IP address using the macvlan CNI plugin:
@@ -138,17 +136,17 @@ The following object describes the configuration parameters for utilizing static
138
136
----
139
137
{
140
138
"cniVersion": "0.3.1",
141
-
"name": "<name>", <1>
142
-
"plugins": [{ <2>
139
+
"name": "<name>",
140
+
"plugins": [{
143
141
"type": "macvlan",
144
-
"capabilities": { "ips": true }, <3>
145
-
"master": "eth0", <4>
142
+
"capabilities": { "ips": true },
143
+
"master": "eth0",
146
144
"mode": "bridge",
147
145
"ipam": {
148
146
"type": "static"
149
147
}
150
148
}, {
151
-
"capabilities": { "mac": true }, <5>
149
+
"capabilities": { "mac": true },
152
150
"type": "tuning"
153
151
}]
154
152
}
@@ -165,8 +163,9 @@ where:
165
163
--
166
164
+
167
165
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.
168
-
+
169
-
Edit the pod with:
166
+
167
+
168
+
. Edit the pod by entering the following command:
170
169
+
171
170
[source,terminal]
172
171
----
@@ -184,24 +183,22 @@ metadata:
184
183
annotations:
185
184
k8s.v1.cni.cncf.io/networks: '[
186
185
{
187
-
"name": "<name>", <1>
188
-
"ips": [ "192.0.2.205/24" ], <2>
189
-
"mac": "CA:FE:C0:FF:EE:00" <3>
186
+
"name": "<name>",
187
+
"ips": [ "192.0.2.205/24" ],
188
+
"mac": "CA:FE:C0:FF:EE:00"
190
189
}
191
190
]'
192
191
----
193
-
<1> Use the `<name>` as provided when creating the `rawCNIConfig` above.
194
-
<2> Provide an IP address including the subnet mask.
195
-
<3> Provide the MAC address.
192
+
+
193
+
--
194
+
where:
195
+
196
+
`name`:: Specifies the name for the secondary network attachment to create. The name must be unique within the specified `namespace`.
197
+
`ips`:: Specifies an IP address including the subnet mask.
198
+
`mac`:: Specifies the MAC address.
199
+
--
196
200
+
197
201
[NOTE]
198
202
====
199
-
Static IP addresses and MAC addresses do not have to be used at the same time, you may use them individually, or together.
203
+
Static IP addresses and MAC addresses do not have to be used at the same time. You can use them individually, or together.
200
204
====
201
-
+
202
-
. 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
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@
6
6
[id="nw-multus-delete-network_{context}"]
7
7
= Removing a secondary network attachment definition
8
8
9
-
As a cluster administrator, you can remove a secondary network from your {product-title} cluster. The secondary network is not removed from any pods it 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.
10
11
11
12
.Prerequisites
12
13
@@ -15,8 +16,6 @@ As a cluster administrator, you can remove a secondary network from your {produc
15
16
16
17
.Procedure
17
18
18
-
To remove a secondary network from your cluster, complete the following steps:
19
-
20
19
. Edit the Cluster Network Operator (CNO) in your default text editor by running the following command:
21
20
+
22
21
[source,terminal]
@@ -33,17 +32,23 @@ kind: Network
33
32
metadata:
34
33
name: cluster
35
34
spec:
36
-
additionalNetworks: [] <1>
35
+
additionalNetworks: []
37
36
----
38
-
<1> If you are removing the configuration mapping for the only secondary network attachment definition in the `additionalNetworks` collection, you must specify an empty collection.
37
+
+
38
+
--
39
+
where:
39
40
40
-
. To remove a network attachment definition from the network of your cluster, enter the following command:
41
+
`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.
42
+
--
43
+
44
+
. 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 a secondary network attachment definition
8
8
9
-
As a cluster administrator, you can make changes to an existing secondary
10
-
network. Any existing pods attached to the secondary 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 secondary network will not be updated
17
18
18
19
.Procedure
19
20
20
-
To edit a secondary 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 secondary 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 secondary 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