Skip to content

Commit 3bf23ab

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 1d130e5 commit 3bf23ab

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
@@ -391,6 +391,13 @@ ovsOvn:
391391
# -- Labels to be added to ovs-ovn pods.
392392
# @section -- OVS/OVN daemons configuration
393393
podLabels: {}
394+
# -- Affinity for ovs-ovn pods.
395+
# @section -- OVS/OVN daemons configuration
396+
affinity: {}
397+
# -- Node selector to restrict the deployment of ovs-ovn to specific nodes.
398+
# @section -- OVS/OVN daemons configuration
399+
nodeSelector:
400+
kubernetes.io/os: "linux"
394401

395402
# -- Extra environment variables to be added to ovs-ovn pods.
396403
# @section -- OVS/OVN daemons configuration
@@ -450,6 +457,14 @@ ovsOvn:
450457
# -- DPDK image tag.
451458
# @section -- OVS/OVN daemons configuration
452459
tag: v1.15.4
460+
# -- Affinity for the ovs-ovn-dpdk DaemonSet.
461+
# @section -- OVS/OVN daemons configuration
462+
affinity: {}
463+
# -- Node selector to restrict the deployment of DPDK-hybrid OVS to specific nodes.
464+
# @section -- OVS/OVN daemons configuration
465+
nodeSelector:
466+
kubernetes.io/os: "linux"
467+
ovn.kubernetes.io/ovs_dp_type: "userspace"
453468
# -- ovs-ovn resource limits & requests when DPDK-hybrid is enabled.
454469
# ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
455470
# @section -- OVS/OVN daemons configuration

0 commit comments

Comments
 (0)