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
You can set interface specific `sysctl` settings on a bonded interface created from two SR-IOV interfaces. Do this by adding the tuning configuration to the optional `Plugins` parameter of the bond network attachment definition.
10
10
@@ -22,16 +22,16 @@ To change specific interface-level network `sysctl` settings create the `SriovNe
22
22
23
23
.Procedure
24
24
25
-
. Create the `SriovNetwork` custom resource (CR) for the bonded interface as in the following example CR. Save the YAML as the file `sriov-network-attachment.yaml`.
25
+
. Create the `SriovNetwork` custom resource (CR) for the bonded interface as in the following example CR. Save the YAML as the file `sriov-network-attachment.yaml`.
26
26
+
27
27
[source,yaml]
28
28
----
29
-
apiVersion: sriovnetwork.openshift.io/v1
30
-
kind: SriovNetwork
31
-
metadata:
29
+
apiVersion: sriovnetwork.openshift.io/v1
30
+
kind: SriovNetwork
31
+
metadata:
32
32
name: allvalidflags <1>
33
33
namespace: openshift-sriov-network-operator <2>
34
-
spec:
34
+
spec:
35
35
resourceName: policyallflags <3>
36
36
networkNamespace: sysctl-tuning-test <4>
37
37
capabilities: '{ "mac": true, "ips": true }' <5>
@@ -65,21 +65,20 @@ spec:
65
65
"plugins":[
66
66
{
67
67
"type":"bond", <1>
68
-
"ifname":"bond0", <2>
69
-
"mode": "active-backup", <3>
70
-
"failOverMac": 1, <4>
71
-
"linksInContainer": true, <5>
68
+
"mode": "active-backup", <2>
69
+
"failOverMac": 1, <3>
70
+
"linksInContainer": true, <4>
72
71
"miimon": "100",
73
-
"links": [ <6>
72
+
"links": [ <5>
74
73
{"name": "net1"},
75
74
{"name": "net2"}
76
75
],
77
-
"ipam":{ <7>
76
+
"ipam":{ <6>
78
77
"type":"static"
79
78
}
80
79
},
81
80
{
82
-
"type":"tuning", <8>
81
+
"type":"tuning", <7>
83
82
"capabilities":{
84
83
"mac":true
85
84
},
@@ -99,19 +98,18 @@ spec:
99
98
}'
100
99
----
101
100
<1> The type is `bond`.
102
-
<2> The `ifname` attribute specifies the name of the bond interface.
103
-
<3> The `mode` attribute specifies the bonding mode. The bonding modes supported are:
101
+
<2> The `mode` attribute specifies the bonding mode. The bonding modes supported are:
104
102
105
-
* `balance-rr` - 0
103
+
* `balance-rr` - 0
106
104
* `active-backup` - 1
107
105
* `balance-xor` - 2
108
106
+
109
107
For `balance-rr` or `balance-xor` modes, you must set the `trust` mode to `on` for the SR-IOV virtual function.
110
-
<4> The `failover` attribute is mandatory for active-backup mode.
111
-
<5> The `linksInContainer=true` flag informs the Bond CNI that the interfaces required are to be found inside the container. By default Bond CNI looks for these interfaces on the host which does not work for integration with SRIOV and Multus.
112
-
<6> The `links` section defines which interfaces will be used to create the bond. By default, Multus names the attached interfaces as: "net", plus a consecutive number, starting with one.
113
-
<7> A configuration object for the IPAM CNI plugin as a YAML block scalar. The plugin manages IP address assignment for the attachment definition. In this pod example IP addresses are configured manually, so in this case`ipam` is set to static.
114
-
<8> Add additional capabilities to the device. For example, set the `type` field to `tuning`. Specify the interface-level network `sysctl` you want to set in the sysctl field. This example sets all interface-level network `sysctl` settings that can be set.
108
+
<3> The `failover` attribute is mandatory for active-backup mode.
109
+
<4> The `linksInContainer=true` flag informs the Bond CNI that the required interfaces are to be found inside the container. By default, Bond CNI looks for these interfaces on the host which does not work for integration with SRIOV and Multus.
110
+
<5> The `links` section defines which interfaces will be used to create the bond. By default, Multus names the attached interfaces as: "net", plus a consecutive number, starting with one.
111
+
<6> A configuration object for the IPAM CNI plugin as a YAML block scalar. The plugin manages IP address assignment for the attachment definition. In this pod example IP addresses are configured manually, so in this case,`ipam` is set to static.
112
+
<7> Add additional capabilities to the device. For example, set the `type` field to `tuning`. Specify the interface-level network `sysctl` you want to set in the sysctl field. This example sets all interface-level network `sysctl` settings that can be set.
<2> Optional: The MAC address for the SR-IOV device that is allocated from the resource type defined in the SR-IOV network attachment definition CR. To use this feature, you also must specify `{ "mac": true }` in the SriovNetwork object.
189
187
<3> Optional: IP addresses for the SR-IOV device that are allocated from the resource type defined in the SR-IOV network attachment definition CR. Both IPv4 and IPv6 addresses are supported. To use this feature, you also must specify `{ "ips": true }` in the `SriovNetwork` object.
190
188
191
-
. Apply the YAML:
189
+
. Apply the YAML:
192
190
+
193
191
[source,terminal]
194
192
----
@@ -214,7 +212,7 @@ tunepod 1/1 Running 0 47s
214
212
+
215
213
[source,terminal]
216
214
----
217
-
$ oc rsh -n sysctl-tuning-test tunepod
215
+
$ oc rsh -n sysctl-tuning-test tunepod
218
216
----
219
217
220
218
. Verify the values of the configured `sysctl` flag. Find the value `net.ipv6.neigh.IFNAME.base_reachable_time_ms` by running the following command::
<2> The `ifname` attribute specifies the name of the bond interface.
60
-
<3> The `mode` attribute specifies the bonding mode.
57
+
<1> The cni-type is always set to `bond`.
58
+
<2> The `mode` attribute specifies the bonding mode.
61
59
+
62
60
[NOTE]
63
61
====
@@ -69,16 +67,16 @@ The bonding modes supported are:
69
67
70
68
For `balance-rr` or `balance-xor` modes, you must set the `trust` mode to `on` for the SR-IOV virtual function.
71
69
====
72
-
<4> The `failover` attribute is mandatory for active-backup mode.
73
-
<5> The `linksInContainer=true` flag informs the Bond CNI that the interfaces required are to be found inside the container. By default Bond CNI looks for these interfaces on the host which does not work for integration with SRIOV and Multus.
74
-
<6> The `links` section defines which interfaces will be used to create the bond. By default, Multus names the attached interfaces as: "net", plus a consecutive number, starting with one.
70
+
<3> The `failover` attribute is mandatory for active-backup mode and must be set to 1.
71
+
<4> The `linksInContainer=true` flag informs the Bond CNI that the required interfaces are to be found inside the container. By default, Bond CNI looks for these interfaces on the host which does not work for integration with SRIOV and Multus.
72
+
<5> The `links` section defines which interfaces will be used to create the bond. By default, Multus names the attached interfaces as: "net", plus a consecutive number, starting with one.
<1> Note the network annotation: it contains two SR-IOV network attachments, and one bond network attachment. The bond attachment uses the two SR-IOV interfaces as bonded port interfaces.
97
95
98
-
You can inspect the pod interfaces with the following command:
96
+
. Apply the yaml by running the following command:
97
+
+
98
+
[source,terminal]
99
+
----
100
+
$ oc apply -f podbonding.yaml
101
+
----
102
+
103
+
. Inspect the pod interfaces with the following command:
<1> The bond interface is automatically named `net3`. To set a specific interface name add `@name` suffix to the pod’s `k8s.v1.cni.cncf.io/networks` annotation.
128
+
<2> The `net1` interface is based on an SR-IOV virtual function.
129
+
<3> The `net2` interface is based on an SR-IOV virtual function.
130
+
+
131
+
[NOTE]
132
+
====
133
+
If no interface names are configured in the pod annotation, interface names are assigned automatically as `net<n>`, with `<n>` starting at `1`.
134
+
====
135
+
136
+
. Optional: If you want to set a specific interface name for example `bond0`, edit the `k8s.v1.cni.cncf.io/networks` annotation and set `bond0` as the interface name as follows:
137
+
+
138
+
[source,terminal]
120
139
----
121
-
<1> The `net1` interface is based on an SR-IOV virtual function.
122
-
<2> The `net2` interface is based on an SR-IOV virtual function.
0 commit comments