diff --git a/src/helm/impress/Chart.yaml b/src/helm/impress/Chart.yaml index 96a61746..b6f5de0f 100644 --- a/src/helm/impress/Chart.yaml +++ b/src/helm/impress/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 type: application name: docs -version: 3.4.0-beta.1 +version: 3.4.0-beta.2 appVersion: latest diff --git a/src/helm/impress/README.md b/src/helm/impress/README.md index 501b4cc3..175bd3cf 100644 --- a/src/helm/impress/README.md +++ b/src/helm/impress/README.md @@ -111,6 +111,7 @@ | `backend.job.command` | The management command to execute | `[]` | | `backend.job.restartPolicy` | The restart policy for the job. | `Never` | | `backend.job.annotations` | Annotations to add to the job [default: argocd.argoproj.io/hook: PostSync] | | +| `backend.cronjobs` | Cronjob name, schedule, command | `[]` | | `backend.probes.liveness.path` | Configure path for backend HTTP liveness probe | `/__heartbeat__` | | `backend.probes.liveness.targetPort` | Configure port for backend HTTP liveness probe | `undefined` | | `backend.probes.liveness.initialDelaySeconds` | Configure initial delay for backend liveness probe | `10` | diff --git a/src/helm/impress/templates/backend_cronjob_list.yaml b/src/helm/impress/templates/backend_cronjob_list.yaml new file mode 100644 index 00000000..5593eb3a --- /dev/null +++ b/src/helm/impress/templates/backend_cronjob_list.yaml @@ -0,0 +1,108 @@ +{{- if .Values.backend.cronjobs -}} +{{- $envVars := include "impress.common.env" (list . .Values.backend) -}} +{{- $fullName := include "impress.backend.fullname" . -}} +{{- $component := "backend" -}} +apiVersion: batch/v1 +kind: CronJobList +items: +{{- range .Values.backend.cronjobs }} + - apiVersion: batch/v1 + kind: CronJob + metadata: + name: {{ $fullName }}-{{ .name }} + namespace: {{ $.Release.Namespace | quote }} + labels: + {{- include "impress.common.labels" (list $ $component) | nindent 8 }} + spec: + schedule: {{ .schedule }} + concurrencyPolicy: {{ .concurrencyPolicy | default "Forbid" }} + successfulJobsHistoryLimit: {{ .successfulJobsHistoryLimit | default 3 }} + failedJobsHistoryLimit: {{ .failedJobsHistoryLimit | default 1 }} + jobTemplate: + spec: + template: + metadata: + name: {{ $fullName }}-{{ .name }} + spec: + {{- if $.Values.image.credentials }} + imagePullSecrets: + - name: {{ include "impress.secret.dockerconfigjson.name" (dict "fullname" (include "impress.fullname" .) "imageCredentials" $.Values.image.credentials) }} + {{- end}} + shareProcessNamespace: {{ $.Values.backend.shareProcessNamespace }} + containers: + {{- with $.Values.backend.sidecars }} + {{- toYaml . | nindent 18 }} + {{- end }} + - name: {{ $.Chart.Name }} + image: "{{ ($.Values.backend.image | default dict).repository | default $.Values.image.repository }}:{{ ($.Values.backend.image | default dict).tag | default $.Values.image.tag }}" + imagePullPolicy: {{ ($.Values.backend.image | default dict).pullPolicy | default $.Values.image.pullPolicy }} + args: + {{- toYaml .command | nindent 22 }} + env: + {{- if $envVars}} + {{- $envVars | indent 22 }} + {{- end }} + {{- with $.Values.backend.securityContext }} + securityContext: + {{- toYaml . | nindent 22 }} + {{- end }} + {{- with $.Values.backend.resources }} + resources: + {{- toYaml . | nindent 22 }} + {{- end }} + volumeMounts: + {{- range $index, $value := $.Values.mountFiles }} + - name: "files-{{ $index }}" + mountPath: {{ $value.path }} + subPath: content + {{- end }} + {{- range $name, $volume := $.Values.backend.persistence }} + - name: "{{ $name }}" + mountPath: "{{ $volume.mountPath }}" + {{- end }} + {{- range $.Values.backend.extraVolumeMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} + restartPolicy: {{ .restartPolicy | default "Never" }} + volumes: + {{- range $index, $value := $.Values.mountFiles }} + - name: "files-{{ $index }}" + configMap: + name: "{{ include "impress.fullname" $ }}-files-{{ $index }}" + {{- end }} + {{- range $name, $volume := $.Values.backend.persistence }} + - name: "{{ $name }}" + {{- if eq $volume.type "emptyDir" }} + emptyDir: {} + {{- else }} + persistentVolumeClaim: + claimName: "{{ $fullName }}-{{ $name }}" + {{- end }} + {{- end }} + {{- range $.Values.backend.extraVolumes }} + - name: {{ .name }} + {{- if .existingClaim }} + persistentVolumeClaim: + claimName: {{ .existingClaim }} + {{- else if .hostPath }} + hostPath: + {{ toYaml .hostPath | nindent 22 }} + {{- else if .csi }} + csi: + {{- toYaml .csi | nindent 22 }} + {{- else if .configMap }} + configMap: + {{- toYaml .configMap | nindent 22 }} + {{- else if .emptyDir }} + emptyDir: + {{- toYaml .emptyDir | nindent 22 }} + {{- else }} + emptyDir: {} + {{- end }} + {{- end }} + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/src/helm/impress/values.yaml b/src/helm/impress/values.yaml index 69e24caf..c2e1c08a 100644 --- a/src/helm/impress/values.yaml +++ b/src/helm/impress/values.yaml @@ -285,6 +285,17 @@ backend: annotations: argocd.argoproj.io/hook: PostSync + # List of cronjob to add + # cronjobs: + # - name: reset-database + # schedule: "0 */2 * * *" + # command: + # - "/bin/sh" + # - "-c" + # - python manage.py flush --no-input + ## @param backend.cronjobs Cronjob name, schedule, command + cronjobs: [] + ## @param backend.probes.liveness.path [nullable] Configure path for backend HTTP liveness probe ## @param backend.probes.liveness.targetPort [nullable] Configure port for backend HTTP liveness probe ## @param backend.probes.liveness.initialDelaySeconds [nullable] Configure initial delay for backend liveness probe