diff --git a/cronjob/templates/_argo_cron_workflow.tpl b/cronjob/templates/_argo_cron_workflow.tpl index 6f63846..7bc8d3b 100644 --- a/cronjob/templates/_argo_cron_workflow.tpl +++ b/cronjob/templates/_argo_cron_workflow.tpl @@ -60,6 +60,18 @@ {{- if .Values.exitNotifications }} onExit: exit-handler {{- end }} + {{- if .Values.pdb }} + {{- if eq .Values.pdb.enable true }} + podDisruptionBudget: + {{- if .Values.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- else }} + # Documentation: https://argoproj.github.io/argo-workflows/fields/#poddisruptionbudgetspec + # Provide arbitrary big number if you don't know how many pods workflow creates + minAvailable: {{ .Values.pdb.minAvailable | default 9999 }} + {{- end }} + {{- end }} + {{- end }} templates: - name: entry steps: diff --git a/cronjob/templates/pdb.yaml b/cronjob/templates/pdb.yaml deleted file mode 100644 index b3f2223..0000000 --- a/cronjob/templates/pdb.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.pdb }} -{{- if eq .Values.pdb.enable true }} -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: {{ .Values.name }} -spec: - {{- if .Values.pdb.maxUnavailable }} - maxUnavailable: {{ .Values.pdb.maxUnavailable }} - {{- else }} - minAvailable: {{ .Values.pdb.minAvailable | default "100%" }} - {{- end }} - selector: - matchLabels: - app: {{ .Values.name }} -{{- end }} -{{- end }} diff --git a/cronjob/values.yaml b/cronjob/values.yaml index d37b3b7..0c7c7e9 100644 --- a/cronjob/values.yaml +++ b/cronjob/values.yaml @@ -151,8 +151,8 @@ serviceaccount: {} suspend: false pdb: - # If you just set "enable: true", default will set to "minAvailable: 100%" unless you have set other parameters. + # If you just set "enable: true", default will set to "minAvailable: 9999" unless you have set other parameters. enable: false # Note: You can specify only one of maxUnavailable and minAvailable in a single PodDisruptionBudget, and if you setting both will only set maxUnavailable. - # minAvailable: 50% - # maxUnavailable: 50% \ No newline at end of file + # minAvailable: 9999 + # maxUnavailable: 0 \ No newline at end of file