diff --git a/helm/reana/README.md b/helm/reana/README.md index e188b588..206b4f92 100644 --- a/helm/reana/README.md +++ b/helm/reana/README.md @@ -54,7 +54,11 @@ This Helm automatically prefixes all names using the release name to avoid colli | `notifications.email_config.smtp_server` | SMTP email server host | None | | `notifications.email_config.smtp_port` | SMTP email server port | None | | `notifications.enabled` | Enable REANA system events notifications | false | +<<<<<<< HEAD | `notifications.system_status` | Cronjob pattern representing how often the system status notification should be sent. Leave it empty to deactivate it | "0 0 * * *" | +======= +| `notifications.system_status` | Cronjob pattern representing how often the system status notification should be sent. Leave it empty to deactivate it | "0 0 * * *" | +>>>>>>> helm: add cronjob to update disk quota nightly | `reana_hostname` | REANA hostname (e.g. reana.example.org) | None | | `namespace_runtime` | Namespace in which the REANA runtime pods (workflow engines, jobs etc...) will run | `.Release.Namespace` | | `naming_scheme` | REANA component naming scheme | None | @@ -82,3 +86,9 @@ This Helm automatically prefixes all names using the release name to avoid colli | `shared_storage.hostpath.root_path` | Path to the REANA directory inside the underlying storage volume | /var/reana | | `traefik.*` | Pass any value from [Traefik Helm chart values](https://github.com/helm/charts/tree/master/stable/traefik#configuration) here, e.g. `traefik.rbac.enabled=true` | - | | `traefik.enabled` | Install Traefik in the cluster when installing REANA | true | +<<<<<<< HEAD +======= +| `volume_paths.root_path` | Path to the REANA directory inside the underlying storage volume | /var/reana | +| `volume_paths.shared_volume_path` | Path inside the REANA components where the shared volume will be mounted | /var/reana | +| `quota.disk_update` | Cronjob pattern representing how often the users disk quota usage should be updated. Leave it empty to deactivate it | "0 3 * * *" | +>>>>>>> helm: add cronjob to update disk quota nightly diff --git a/helm/reana/templates/cronjobs.yaml b/helm/reana/templates/cronjobs.yaml index 0f0852b4..99e676c9 100644 --- a/helm/reana/templates/cronjobs.yaml +++ b/helm/reana/templates/cronjobs.yaml @@ -104,3 +104,73 @@ spec: path: /code/reana-server {{- end }} {{- end }} +--- +{{- if .Values.quota.disk_update }} +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: {{ include "reana.prefix" . }}-disk-quota-update + namespace: {{ .Release.Namespace }} +spec: + schedule: "{{ .Values.quota.disk_update }}" + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 + jobTemplate: + spec: + template: + spec: + containers: + - name: {{ include "reana.prefix" . }}-disk-quota-update + image: {{ .Values.components.reana_server.image }} + command: + - '/bin/sh' + - '-c' + args: + - 'reana-db quota disk-usage-update' + {{- if .Values.debug.enabled }} + tty: true + stdin: true + {{- end }} + env: + {{- range $key, $value := .Values.db_env_config }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- if .Values.debug.enabled }} + - name: FLASK_ENV + value: "development" + {{- else }} + - name: REANA_DB_USERNAME + valueFrom: + secretKeyRef: + name: {{ include "reana.prefix" . }}-db-secrets + key: user + - name: REANA_DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "reana.prefix" . }}-db-secrets + key: password + {{- end }} + volumeMounts: + {{- if .Values.debug.enabled }} + - mountPath: /code/ + name: reana-code + {{- end }} + - mountPath: {{ .Values.shared_storage.shared_volume_mount_path }} + name: reana-shared-volume + imagePullPolicy: IfNotPresent + restartPolicy: Never + volumes: + - name: reana-shared-volume + {{- if not (eq .Values.shared_storage.backend "hostpath") }} + persistentVolumeClaim: + claimName: {{ include "reana.prefix" . }}-shared-persistent-volume + readOnly: false + {{- else }} + hostPath: + path: {{ .Values.shared_storage.hostpath.root_path }} + {{- end }} + - name: reana-code + hostPath: + path: /code/reana-server +{{- end }} diff --git a/helm/reana/values.yaml b/helm/reana/values.yaml index 386e500e..ab817c38 100644 --- a/helm/reana/values.yaml +++ b/helm/reana/values.yaml @@ -113,3 +113,7 @@ traefik: ssl: enabled: true generateTLS: true + +# Quota +quota: + disk_update: "0 3 * * *" # everyday at 3am