From 57cf795ce61c5647ed571354c0d753456069f5ac Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Tue, 1 Oct 2024 10:58:20 +0100 Subject: [PATCH 1/4] MAP-1636 cron job recovery --- helm_deploy/use-of-force/templates/job.yaml | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 helm_deploy/use-of-force/templates/job.yaml diff --git a/helm_deploy/use-of-force/templates/job.yaml b/helm_deploy/use-of-force/templates/job.yaml new file mode 100644 index 00000000..3b6b6fc8 --- /dev/null +++ b/helm_deploy/use-of-force/templates/job.yaml @@ -0,0 +1,25 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: send-reminders + labels: + {{- include "app.labels" . | nindent 4 }} +spec: + schedule: "*/5 * * * *" + concurrencyPolicy: Replace + failedJobsHistoryLimit: 5 + startingDeadlineSeconds: 300 + successfulJobsHistoryLimit: 5 + jobTemplate: + spec: + template: + spec: + containers: + - name: use-of-force + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + args: + - node + - job/sendReminders +{{ include "deployment.envs" . | nindent 12 }} + restartPolicy: Never + activeDeadlineSeconds: 240 From 2eb90e5075328329e261061b2523257f700499cc Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Tue, 1 Oct 2024 11:15:43 +0100 Subject: [PATCH 2/4] MAP-1636 cron job recovery --- helm_deploy/use-of-force/templates/_helpers.tpl | 15 +++++++++++++++ helm_deploy/use-of-force/templates/job.yaml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 helm_deploy/use-of-force/templates/_helpers.tpl diff --git a/helm_deploy/use-of-force/templates/_helpers.tpl b/helm_deploy/use-of-force/templates/_helpers.tpl new file mode 100644 index 00000000..22d8a6d2 --- /dev/null +++ b/helm_deploy/use-of-force/templates/_helpers.tpl @@ -0,0 +1,15 @@ +{{/* Short name for root chart */}} +{{- define "uof.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* Labels set on all resources: none are used as selectors */}} +{{- define "uof.labels" -}} +helm.sh/chart: {{ include "uof.chart" . }} +{{- $appVersion := index .Values "generic-service" "image" "tag" }} +{{- if $appVersion }} +app.kubernetes.io/version: {{ $appVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: {{ include "generic-service.name" . }} +{{- end }} \ No newline at end of file diff --git a/helm_deploy/use-of-force/templates/job.yaml b/helm_deploy/use-of-force/templates/job.yaml index 3b6b6fc8..59f9f529 100644 --- a/helm_deploy/use-of-force/templates/job.yaml +++ b/helm_deploy/use-of-force/templates/job.yaml @@ -3,7 +3,7 @@ kind: CronJob metadata: name: send-reminders labels: - {{- include "app.labels" . | nindent 4 }} + {{- include "uof.labels" . | nindent 4 }} spec: schedule: "*/5 * * * *" concurrencyPolicy: Replace From fe9a6a75f0754483eb299e8f88fb6c57ee564e25 Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Tue, 1 Oct 2024 11:24:48 +0100 Subject: [PATCH 3/4] MAP-1636 cron job recovery --- helm_deploy/use-of-force/templates/job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm_deploy/use-of-force/templates/job.yaml b/helm_deploy/use-of-force/templates/job.yaml index 59f9f529..fa3f3021 100644 --- a/helm_deploy/use-of-force/templates/job.yaml +++ b/helm_deploy/use-of-force/templates/job.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: use-of-force - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: {{ with index .Values "generic-service" }}{{ .image.repository }}:{{ .image.tag }}{{ end }} args: - node - job/sendReminders From 2172e899c7e90390bb1b63deed1c230b36115a89 Mon Sep 17 00:00:00 2001 From: Michal Nawrocki Date: Tue, 1 Oct 2024 11:32:54 +0100 Subject: [PATCH 4/4] MAP-1636 cron job recovery --- helm_deploy/use-of-force/templates/_helpers.tpl | 15 --------------- helm_deploy/use-of-force/templates/job.yaml | 2 -- 2 files changed, 17 deletions(-) delete mode 100644 helm_deploy/use-of-force/templates/_helpers.tpl diff --git a/helm_deploy/use-of-force/templates/_helpers.tpl b/helm_deploy/use-of-force/templates/_helpers.tpl deleted file mode 100644 index 22d8a6d2..00000000 --- a/helm_deploy/use-of-force/templates/_helpers.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{{/* Short name for root chart */}} -{{- define "uof.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* Labels set on all resources: none are used as selectors */}} -{{- define "uof.labels" -}} -helm.sh/chart: {{ include "uof.chart" . }} -{{- $appVersion := index .Values "generic-service" "image" "tag" }} -{{- if $appVersion }} -app.kubernetes.io/version: {{ $appVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/part-of: {{ include "generic-service.name" . }} -{{- end }} \ No newline at end of file diff --git a/helm_deploy/use-of-force/templates/job.yaml b/helm_deploy/use-of-force/templates/job.yaml index fa3f3021..8e3c5de3 100644 --- a/helm_deploy/use-of-force/templates/job.yaml +++ b/helm_deploy/use-of-force/templates/job.yaml @@ -2,8 +2,6 @@ apiVersion: batch/v1 kind: CronJob metadata: name: send-reminders - labels: - {{- include "uof.labels" . | nindent 4 }} spec: schedule: "*/5 * * * *" concurrencyPolicy: Replace