Skip to content

Commit fda200c

Browse files
authored
Add option to configure additional CNI plugins for sriov and multus interface types (#18)
1 parent 9115b3a commit fda200c

File tree

14 files changed

+183
-18
lines changed

14 files changed

+183
-18
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
The v2 release supports Cisco IOS-XR release version 24.4.1 and above.
88

9+
#### v2.1.0
10+
11+
- Add `additionalCNIConfig` option under SR-IOV and Multus interfaces for configuring additional CNI plugins
12+
913
#### v2.0.0
1014

1115
- Change `cpu.hyperThreadingMode` options, adding `auto` and removing `off`.
@@ -19,3 +23,7 @@ The v1 release supports Cisco IOS-XR release versions from 7.7.1 to 24.3.1.
1923
### v1 (active)
2024

2125
The v1 release supports Cisco IOS-XR release versions 7.7.1 and above.
26+
27+
#### v1.2.0
28+
29+
- Add `additionalCNIConfig` option under SR-IOV and Multus interfaces for configuring additional CNI plugins

charts/xrd-common/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ keywords:
88
- xrd
99
sources:
1010
- https://github.com/ios-xr/xrd-helm
11-
version: 1.1.0
11+
version: 1.2.0

charts/xrd-common/templates/_interfaces.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ or an empty string otherwise.
6666

6767
{{- define "xrd.interfaces.linuxflags" -}}
6868
{{- $flags := list }}
69-
{{- $base := list "type" "config" "attachmentConfig" "resource" }}
69+
{{- $base := list "type" "config" "attachmentConfig" "resource" "additionalCNIConfig" }}
7070
{{- range $k, $v := . -}}
7171
{{- if eq $k "snoopIpv4Address" }}
7272
{{- if $v }}
@@ -113,7 +113,7 @@ or an empty string otherwise.
113113

114114
{{- define "xrd.interfaces.sriovflags" -}}
115115
{{- $flags := list }}
116-
{{- $base := list "type" "config" "resource" }}
116+
{{- $base := list "type" "config" "resource" "additionalCNIConfig" }}
117117
{{- range $k, $v := . -}}
118118
{{- if not (has $k $base) }}
119119
{{- fail (printf "%s may not be specified for sriov interfaces" $k) }}

charts/xrd-common/templates/_network-attachments.tpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ spec:
2424
{
2525
"cniVersion": "0.3.1",
2626
"name": "{{ include "xrd.fullname" $ }}-{{ $cniIndex }}",
27-
"plugins": [
28-
{{- $intf.config | toPrettyJson | nindent 8 }}
29-
]
27+
"plugins": {{- prepend ( $intf.additionalCNIConfig | default list ) $intf.config | toPrettyJson | nindent 8 }}
3028
}
3129
...
3230
{{- $cniIndex = add1 $cniIndex}}

charts/xrd-control-plane/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ keywords:
88
- xrd
99
sources:
1010
- https://github.com/ios-xr/xrd-helm
11-
version: 1.1.0
11+
version: 1.2.0
1212
dependencies:
1313
- name: xrd-common
14-
version: 1.1.0
14+
version: 1.2.0
1515
repository: "file://../xrd-common"

charts/xrd-control-plane/templates/_interfaces.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
{{- if hasKey . "attachmentConfig" }}
1111
{{- fail "attachmentConfig may not be specified for defaultCni interfaces" }}
1212
{{- end }}
13+
{{- if hasKey . "additionalCNIConfig" }}
14+
{{- fail "additionalCNIConfig may not be specified for PCI interfaces" }}
15+
{{- end }}
1316
{{- if hasKey . "resource" }}
1417
{{- fail "resource may not be specified for defaultCni interface types" }}
1518
{{- end }}
@@ -54,6 +57,9 @@
5457
{{- if hasKey . "attachmentConfig" }}
5558
{{- fail "attachmentConfig may not be specified for defaultCni mgmt interfaces" }}
5659
{{- end }}
60+
{{- if hasKey . "additionalCNIConfig" }}
61+
{{- fail "additionalCNIConfig may not be specified for PCI interfaces" }}
62+
{{- end }}
5763
{{- if hasKey . "resource" }}
5864
{{- fail "resource may not be specified for defaultCni mgmt interface types" }}
5965
{{- end }}

charts/xrd-control-plane/values.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@
270270
"description": "Type-dependent configuration",
271271
"type": "object"
272272
},
273+
"additionalCNIConfig": {
274+
"description": "Config for additional CNI pluginsm for multus and sriov-type interfaces only",
275+
"type": "array",
276+
"items": {
277+
"type": "object"
278+
}
279+
},
273280
"attachmentConfig": {
274281
"description": "Network attachment annotation configuration, for multus-type interfaces only",
275282
"type": "object"
@@ -333,6 +340,13 @@
333340
"description": "Type-dependent configuration",
334341
"type": "object"
335342
},
343+
"additionalCNIConfig": {
344+
"description": "Config for additional CNI pluginsm for multus and sriov-type interfaces only",
345+
"type": "array",
346+
"items": {
347+
"type": "object"
348+
}
349+
},
336350
"attachmentConfig": {
337351
"description": "Network attachment annotation configuration, for multus-type interfaces only",
338352
"type": "object"

charts/xrd-control-plane/values.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ config:
204204
# linux interface is found, and XR configuration for that IPv4 address
205205
# on the corresponding XR interface is generated and applied on XRd startup.
206206
#
207+
# On 'sriov' and 'multus' interfaces and management interfaces, config for
208+
# additional CNI plugins can be specified under the 'additionalCNIConfig' field.
209+
# This is a list of CNI plugin configurations to be applied in order.
210+
#
207211
# XRd line interfaces.
208212
interfaces: []
209213
# Example interfaces:
@@ -217,6 +221,17 @@ interfaces: []
217221
# config:
218222
# type: sriov
219223
# vlan: 1
224+
#- type: sriov
225+
# resource: intel.com/intel_sriov_netdevice_2
226+
# config:
227+
# type: sriov
228+
# vlan: 1
229+
# additionalCNIConfig:
230+
# - type: tuning
231+
# capabilities:
232+
# mac: true
233+
# allmulti: true
234+
# promisc: true
220235

221236
# XRd management interfaces.
222237
mgmtInterfaces: []
@@ -236,7 +251,7 @@ mgmtInterfaces: []
236251
# ips:
237252
# - "10.0.0.1/24"
238253
#- type: sriov
239-
# resource: intel.com/intel_sriov_netdevice_2
254+
# resource: intel.com/intel_sriov_netdevice_3
240255
# config:
241256
# type: sriov
242257

charts/xrd-vrouter/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ keywords:
88
- xrd
99
sources:
1010
- https://github.com/ios-xr/xrd-helm
11-
version: 2.0.0
11+
version: 2.1.0
1212
dependencies:
1313
- name: xrd-common
14-
version: 1.1.0
14+
version: 1.2.0
1515
repository: "file://../xrd-common"

charts/xrd-vrouter/templates/_interfaces.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
{{- if hasKey . "attachmentConfig" }}
1212
{{- fail "attachmentConfig may not be specified for PCI interfaces" }}
1313
{{- end }}
14+
{{- if hasKey . "additionalCNIConfig" }}
15+
{{- fail "additionalCNIConfig may not be specified for PCI interfaces" }}
16+
{{- end }}
1417
{{- if hasKey . "resource" }}
1518
{{- fail "resource may not be specified for PCI interfaces" }}
1619
{{- end }}
@@ -88,6 +91,9 @@
8891
{{- if hasKey . "attachmentConfig" }}
8992
{{- fail "attachmentConfig may not be specified for defaultCni mgmt interface types" }}
9093
{{- end }}
94+
{{- if hasKey . "additionalCNIConfig" }}
95+
{{- fail "additionalCNIConfig may not be specified for PCI interfaces" }}
96+
{{- end }}
9197
{{- if (hasKey . "xrName") }}
9298
{{- fail "xrName may not be specified for interfaces on XRd vRouter" }}
9399
{{- end }}

0 commit comments

Comments
 (0)