From 254b6390df6a0c202b210414b1f443b3f5bd9fe4 Mon Sep 17 00:00:00 2001 From: devops-mher Date: Tue, 30 May 2023 11:57:53 +0400 Subject: [PATCH] update cronjob --- charts/backend/Chart.yaml | 2 +- .../{configmap-cronjob.yam => configmap-cronjob.yaml} | 0 charts/backend/templates/cronjob.yaml | 7 ++++++- charts/backend/values.yaml | 7 ++++--- 4 files changed, 11 insertions(+), 5 deletions(-) rename charts/backend/templates/{configmap-cronjob.yam => configmap-cronjob.yaml} (100%) diff --git a/charts/backend/Chart.yaml b/charts/backend/Chart.yaml index 258836a..a00eb55 100644 --- a/charts/backend/Chart.yaml +++ b/charts/backend/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: backend description: Helm chart scaffolding for Backend applications. type: application -version: 3.6.0 +version: 3.6.1 appVersion: 1.3.0 diff --git a/charts/backend/templates/configmap-cronjob.yam b/charts/backend/templates/configmap-cronjob.yaml similarity index 100% rename from charts/backend/templates/configmap-cronjob.yam rename to charts/backend/templates/configmap-cronjob.yaml diff --git a/charts/backend/templates/cronjob.yaml b/charts/backend/templates/cronjob.yaml index 5ec2a07..e2f51ff 100644 --- a/charts/backend/templates/cronjob.yaml +++ b/charts/backend/templates/cronjob.yaml @@ -1,3 +1,4 @@ +{{- if .Values.cronjob.enabled }} apiVersion: batch/v1 kind: CronJob metadata: @@ -48,7 +49,10 @@ spec: name: {{ $v.name }} {{- end }} {{- end }} - + {{- with .Values.cronjob.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: "{{ include "laravel.fullname" . }}" image: "{{ .Values.cronjob.image.repository }}:{{ .Values.cronjob.image.tag }}" @@ -94,3 +98,4 @@ spec: name: {{ $v.name }} {{- end }} {{- end }} +{{- end }} diff --git a/charts/backend/values.yaml b/charts/backend/values.yaml index f01c06b..bffa252 100644 --- a/charts/backend/values.yaml +++ b/charts/backend/values.yaml @@ -279,12 +279,13 @@ externalsecrets: - DB_USERNAME cronjob: - schedule: "*/1 * * * *" + enabled: false + schedule: "* * * * *" concurrencyPolicy: "Forbid" restartPolicy: "Never" - failedJobsHistoryLimit: 1 + failedJobsHistoryLimit: 10 successfulJobsHistoryLimit: 1 - + nodeSelector: {} image: repository: "busybox" tag: "latest"