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/cnf-assigning-a-secondary-network-to-a-vrf.adoc
+22-14Lines changed: 22 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,20 +23,16 @@ The Cluster Network Operator (CNO) manages additional network definitions. When
23
23
Do not edit the `NetworkAttachmentDefinition` CRs that the Cluster Network Operator manages. Doing so might disrupt network traffic on your additional network.
24
24
====
25
25
26
+
To create an additional network attachment with the CNI VRF plug-in, perform the following procedure.
27
+
26
28
.Prerequisites
27
29
28
30
* Install the {product-title} CLI (oc).
29
31
* Log in to the OpenShift cluster as a user with cluster-admin privileges.
30
32
31
33
.Procedure
32
34
33
-
. Create the CNO CR by running the following command:
34
-
+
35
-
[source,terminal]
36
-
----
37
-
$ oc edit networks.operator.openshift.io cluster
38
-
----
39
-
. Extend the CR that you are creating by adding the `rawCNIConfig` configuration for the additional network, as in the example CR below. The following YAML configures the CNI VRF plug-in:
35
+
. Create the `Network` custom resource (CR) for the additional network attachment and insert the `rawCNIConfig` configuration for the additional network, as in the following example CR. Save the YAML as the file `additional-network-attachment.yaml`.
40
36
+
41
37
[source,yaml]
42
38
----
@@ -47,7 +43,7 @@ metadata:
47
43
spec:
48
44
additionalNetworks:
49
45
- name: test-network-1
50
-
namespace: test-1
46
+
namespace: additional-network-1
51
47
type: Raw
52
48
rawCNIConfig: '{
53
49
"cniVersion": "0.3.1",
@@ -72,17 +68,24 @@ metadata:
72
68
}]
73
69
}'
74
70
----
75
-
<1> `plugins` must be a list. The first item in the list must be secondary network underpinning the VRF network. The second item in the list is the VRF plugin configuration.
71
+
<1> `plugins` must be a list. The first item in the list must be the secondary network underpinning the VRF network. The second item in the list is the VRF plugin configuration.
76
72
<2> `type` must be set to `vrf`.
77
73
<3> `vrfname` is the name of the VRF that the interface is assigned to. If it does not exist in the pod, it is created.
78
-
<4> `table` is the routing table ID. Optional. By default, the `tableid` parameter is used. If it is not specified, the CNI assigns a free routing table ID to the VRF.
74
+
<4> Optional. `table` is the routing table ID. By default, the `tableid` parameter is used. If it is not specified, the CNI assigns a free routing table ID to the VRF.
79
75
+
80
76
[NOTE]
81
77
====
82
-
VRF will function correctly only when the resource is of type `netdevice`.
78
+
VRF functions correctly only when the resource is of type `netdevice`.
83
79
====
84
-
. Save your changes and quit the text editor to commit your changes.
85
-
. Confirm that the CNO created the `NetworkAttachmentDefinition` CR by running the following command. Replace `<namespace>` with the namespace that you specified when configuring the network attachment. There might be a delay before the CNO creates the CR.
80
+
81
+
. Create the `Network` resource:
82
+
+
83
+
[source,terminal]
84
+
----
85
+
$ oc create -f additional-network-attachment.yaml
86
+
----
87
+
88
+
. Confirm that the CNO created the `NetworkAttachmentDefinition` CR by running the following command. Replace `<namespace>` with the namespace that you specified when configuring the network attachment, for example, `additional-network-1`.
86
89
+
87
90
[source,terminal]
88
91
----
@@ -95,14 +98,19 @@ $ oc get network-attachment-definitions -n <namespace>
95
98
NAME AGE
96
99
additional-network-1 14m
97
100
----
101
+
+
102
+
[NOTE]
103
+
====
104
+
There might be a delay before the CNO creates the CR.
105
+
====
98
106
99
107
.Verifying that the additional VRF network attachment is successful
100
108
101
109
To verify that the VRF CNI is correctly configured and the additional network attachment is attached, do the following:
102
110
103
111
. Create a network that uses the VRF CNI.
104
112
. Assign the network to a pod.
105
-
. Verify that the pod network attachment is connected to the VRF additional network. SSH into the pod and run the following command:
113
+
. Verify that the pod network attachment is connected to the VRF additional network. Remote shell into the pod and run the following command:
Copy file name to clipboardExpand all lines: modules/cnf-assigning-a-sriov-network-to-a-vrf.adoc
+26-14Lines changed: 26 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,19 +24,16 @@ The SR-IOV Network Operator manages additional network definitions. When you spe
24
24
Do not edit `NetworkAttachmentDefinition` custom resources that the SR-IOV Network Operator manages. Doing so might disrupt network traffic on your additional network.
25
25
====
26
26
27
+
To create an additional SR-IOV network attachment with the CNI VRF plug-in, perform the following procedure.
28
+
27
29
.Prerequisites
30
+
28
31
* Install the {product-title} CLI (oc).
29
32
* Log in to the {product-title} cluster as a user with cluster-admin privileges.
30
33
31
34
.Procedure
32
-
. Create the `SriovNetwork` CR by running the following command:
33
-
+
34
-
[source,terminal]
35
-
----
36
-
$ oc create sriovnetwork.openshift.io cluster
37
-
----
38
-
. Extend the CR that you are creating by adding the `metaPlugins` configuration for the additional network you are creating, as in the following example CR.
39
-
. Save your changes and quit the text editor to commit your changes. The following YAML configures the `SriovNetwork` object:
35
+
36
+
. Create the `SriovNetwork` custom resource (CR) for the additional SR-IOV network attachment and insert the `metaPlugins` configuration, as in the following example CR. Save the YAML as the file `sriov-network-attachment.yaml`.
40
37
+
41
38
[source,yaml]
42
39
----
@@ -68,28 +65,42 @@ spec:
68
65
<1> `type` must be set to `vrf`.
69
66
<2> `vrfname` is the name of the VRF that the interface is assigned to. If it does not exist in the pod, it is created.
70
67
71
-
.Verify the `NetworkAttachmentDefinition` CR is successfully created
72
-
Confirm that the SR-IOV Network Operator created the `NetworkAttachmentDefinition` CR by running the following command. Replace `<namespace>` with the namespace that you specified when configuring the network attachment. There might be a delay before the SR-IOV Network Operator creates the CR.
73
-
68
+
. Create the `SriovNetwork` resource:
69
+
+
74
70
[source,terminal]
75
71
----
76
-
$ oc get network-attachment-definitions -n <namespace>
72
+
$ oc create -f sriov-network-attachment.yaml
77
73
----
78
74
75
+
.Verifying that the `NetworkAttachmentDefinition` CR is successfully created
76
+
77
+
* Confirm that the SR-IOV Network Operator created the `NetworkAttachmentDefinition` CR by running the following command.
78
+
+
79
+
[source,terminal]
80
+
----
81
+
$ oc get network-attachment-definitions -n <namespace> <1>
82
+
----
83
+
<1> Replace `<namespace>` with the namespace that you specified when configuring the network attachment, for example, `additional-sriov-network-1`.
84
+
+
79
85
.Example output
80
86
[source,terminal]
81
87
----
82
88
NAME AGE
83
89
additional-sriov-network-1 14m
84
90
----
91
+
+
92
+
[NOTE]
93
+
====
94
+
There might be a delay before the SR-IOV Network Operator creates the CR.
95
+
====
85
96
86
97
.Verifying that the additional SR-IOV network attachment is successful
87
98
88
99
To verify that the VRF CNI is correctly configured and the additional SR-IOV network attachment is attached, do the following:
89
100
90
101
. Create an SR-IOV network that uses the VRF CNI.
91
102
. Assign the network to a pod.
92
-
. Verify that the pod network attachment is connected to the SR-IOV additional network. SSH into the pod and run the following command:
103
+
. Verify that the pod network attachment is connected to the SR-IOV additional network. Remote shell into the pod and run the following command:
93
104
+
94
105
[source,terminal]
95
106
----
@@ -113,6 +124,7 @@ $ ip link
113
124
.Example output
114
125
[source,terminal]
115
126
----
127
+
...
116
128
5: net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master red state UP mode
0 commit comments