Skip to content

Commit cdd8ded

Browse files
oujonnyoilbeater
authored andcommitted
feat(chart): make DaemonSet update strategy configurable in values.yaml (#6136)
Signed-off-by: oujonny <jonny@immerda.ch> (cherry picked from commit 66525ea)
1 parent dea20c4 commit cdd8ded

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

charts/kube-ovn-v2/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Get IPs of master nodes from values
117117
{{- end -}}
118118
{{- end -}}
119119
{{- else -}}
120-
RollingUpdate
120+
{{- $.Values.ovsOvn.updateStrategy -}}
121121
{{- end -}}
122122
{{- end -}}
123123

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ spec:
1818
app.kubernetes.io/part-of: kube-ovn
1919
updateStrategy:
2020
type: {{ include "kubeovn.ovs-ovn.updateStrategy" . }}
21+
{{- if eq (include "kubeovn.ovs-ovn.updateStrategy" .) "RollingUpdate" }}
2122
rollingUpdate:
22-
maxSurge: 1
23-
maxUnavailable: 0
23+
maxSurge: {{ .Values.ovsOvn.strategy.rollingUpdate.maxSurge }}
24+
maxUnavailable: {{ .Values.ovsOvn.strategy.rollingUpdate.maxUnavailable }}
25+
{{- end }}
2426
template:
2527
metadata:
2628
{{- with .Values.ovsOvn.podAnnotations }}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ spec:
1818
app.kubernetes.io/name: kube-ovn-ovs-dpdk
1919
app.kubernetes.io/part-of: kube-ovn
2020
updateStrategy:
21-
type: RollingUpdate
21+
type: {{ .Values.ovsOvn.updateStrategy.type }}
22+
{{- if eq .Values.ovsOvn.updateStrategy.type "RollingUpdate" }}
2223
rollingUpdate:
23-
maxSurge: 1
24-
maxUnavailable: 0
24+
maxSurge: {{ .Values.ovsOvn.strategy.rollingUpdate.maxSurge }}
25+
maxUnavailable: {{ .Values.ovsOvn.strategy.rollingUpdate.maxUnavailable }}
26+
{{- end }}
2527
template:
2628
metadata:
2729
{{- with .Values.ovsOvn.podAnnotations }}

charts/kube-ovn-v2/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,14 @@ ovsOvn:
365365
cpu: "2"
366366
memory: "1000Mi"
367367

368+
# -- ovs-ovn DaemonSet update strategy.
369+
# ref: https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy
370+
# @section -- OVS/OVN daemons configuration
371+
updateStrategy:
372+
type: "RollingUpdate"
373+
maxSurge: 1
374+
maxUnavailable: 0
375+
368376
# -- Disable auto-loading of kernel modules by OVS.
369377
# If this is disabled, you will have to enable the Open vSwitch kernel module yourself.
370378
# @section -- OVS/OVN daemons configuration

0 commit comments

Comments
 (0)