Skip to content

Commit 2e8b9be

Browse files
moreteoilbeater
authored andcommitted
feat(helm):Add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart (#6308)
* feat: add affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets using v2 chart Signed-off-by: Juan Morete <juan.morete@swisscom.com> * feat(chart): Add custom affinity and nodeSelector support for ovs-ovn and ovs-ovn-dpdk DaemonSets Signed-off-by: Juan Morete <juan.morete@swisscom.com> --------- Signed-off-by: Juan Morete <juan.morete@swisscom.com>
1 parent a0afa85 commit 2e8b9be

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

charts/kube-ovn-v2/templates/ovs-ovn/ovs-ovn-daemonset.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ spec:
4747
operator: Exists
4848
- key: CriticalAddonsOnly
4949
operator: Exists
50+
{{- with .Values.ovsOvn.affinity }}
51+
affinity:
52+
{{- toYaml . | nindent 8 }}
53+
{{- end }}
5054
priorityClassName: system-node-critical
5155
serviceAccountName: ovn-ovs
5256
automountServiceAccountToken: true
@@ -188,8 +192,10 @@ spec:
188192
resources:
189193
{{- toYaml . | trim | nindent 12 }}
190194
{{- end }}
195+
{{- with .Values.ovsOvn.nodeSelector }}
191196
nodeSelector:
192-
kubernetes.io/os: "linux"
197+
{{- toYaml . | nindent 8 }}
198+
{{- end }}
193199
volumes:
194200
- name: usr-local-sbin
195201
emptyDir: {}

charts/kube-ovn-v2/templates/ovs-ovn/ovs-ovn-dpdk-daemonset.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ spec:
4343
spec:
4444
tolerations:
4545
- operator: Exists
46+
{{- with .Values.ovsOvn.dpdkHybrid.affinity }}
47+
affinity:
48+
{{- toYaml . | nindent 8 }}
49+
{{- end }}
4650
priorityClassName: system-node-critical
4751
serviceAccountName: ovn-ovs
4852
automountServiceAccountToken: true
@@ -132,9 +136,10 @@ spec:
132136
resources:
133137
{{- toYaml . | trim | nindent 12 }}
134138
{{- end }}
139+
{{- with .Values.ovsOvn.dpdkHybrid.nodeSelector }}
135140
nodeSelector:
136-
kubernetes.io/os: "linux"
137-
ovn.kubernetes.io/ovs_dp_type: "userspace"
141+
{{- toYaml . | nindent 8 }}
142+
{{- end }}
138143
volumes:
139144
- name: host-config-ovs
140145
hostPath:

charts/kube-ovn-v2/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,13 @@ ovsOvn:
358358
# -- Labels to be added to ovs-ovn pods.
359359
# @section -- OVS/OVN daemons configuration
360360
podLabels: {}
361+
# -- Affinity for ovs-ovn pods.
362+
# @section -- OVS/OVN daemons configuration
363+
affinity: {}
364+
# -- Node selector to restrict the deployment of ovs-ovn to specific nodes.
365+
# @section -- OVS/OVN daemons configuration
366+
nodeSelector:
367+
kubernetes.io/os: "linux"
361368

362369
# -- Extra environment variables to be added to ovs-ovn pods.
363370
# @section -- OVS/OVN daemons configuration
@@ -417,6 +424,14 @@ ovsOvn:
417424
# -- DPDK image tag.
418425
# @section -- OVS/OVN daemons configuration
419426
tag: v1.14.32
427+
# -- Affinity for the ovs-ovn-dpdk DaemonSet.
428+
# @section -- OVS/OVN daemons configuration
429+
affinity: {}
430+
# -- Node selector to restrict the deployment of DPDK-hybrid OVS to specific nodes.
431+
# @section -- OVS/OVN daemons configuration
432+
nodeSelector:
433+
kubernetes.io/os: "linux"
434+
ovn.kubernetes.io/ovs_dp_type: "userspace"
420435
# -- ovs-ovn resource limits & requests when DPDK-hybrid is enabled.
421436
# ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
422437
# @section -- OVS/OVN daemons configuration

0 commit comments

Comments
 (0)