Skip to content

Commit

Permalink
feat(discourse): add delete sidekiq jobs cronjob (#168)
Browse files Browse the repository at this point in the history
* feat(discourse): add delete sidekiq jobs cronjob

* fix(discourse): add restart policy to cronjob

Signed-off-by: Robert Müller <[email protected]>

---------

Signed-off-by: Robert Müller <[email protected]>
Co-authored-by: Robert Müller <[email protected]>
  • Loading branch information
ahoneiser and Flipez committed Mar 21, 2024
1 parent 9c3d0aa commit bcf84bf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/discourse/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 2,7 @@ apiVersion: v2
name: discourse
description: A Helm Chart for Mozilla's Discourse application
type: application
version: 3.0.6
version: 3.0.7
appVersion: f58ded6
keywords:
- Mozilla
Expand Down
31 changes: 31 additions & 0 deletions charts/discourse/templates/cronjobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 1,31 @@
{{- range $cronjob_name, $cronjob := .Values.cronjobs }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ $cronjob_name }}

spec:
suspend: {{ $cronjob.suspend }}
schedule: {{ $cronjob.schedule |quote }}
jobTemplate:
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: {{ $cronjob_name }}
image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
command:
{{- toYaml $cronjob.command | nindent 16 }}

envFrom:
- configMapRef:
name: {{ $.Values.deployment.name }}
{{- if $.Values.externalSecrets.enabled }}

- secretRef:
name: {{ $.Values.deployment.name }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/discourse/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 1,4 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down

0 comments on commit bcf84bf

Please sign in to comment.