Browse Source

Merge pull request #464 from truenas/NAS-115798

NAS-115798 / 22.12 / Add cronjobs for nextcloud app
M. Rehan 3 years ago
parent
commit
26b14e8851
56 changed files with 152 additions and 2 deletions
  1. 0 0
      charts/nextcloud/1.6.0/.helmignore
  2. 0 0
      charts/nextcloud/1.6.0/Chart.lock
  3. 1 1
      charts/nextcloud/1.6.0/Chart.yaml
  4. 0 0
      charts/nextcloud/1.6.0/README.md
  5. 0 0
      charts/nextcloud/1.6.0/app-readme.md
  6. 0 0
      charts/nextcloud/1.6.0/charts/common-2112.0.0.tgz
  7. 0 0
      charts/nextcloud/1.6.0/ix_values.yaml
  8. 0 0
      charts/nextcloud/1.6.0/migrations/migrate_from_1.1.0
  9. 23 0
      charts/nextcloud/1.6.0/questions.yaml
  10. 0 0
      charts/nextcloud/1.6.0/requirements.lock
  11. 0 0
      charts/nextcloud/1.6.0/templates/NOTES.txt
  12. 0 0
      charts/nextcloud/1.6.0/templates/_nginx.tpl
  13. 0 0
      charts/nextcloud/1.6.0/templates/_postgres.tpl
  14. 0 0
      charts/nextcloud/1.6.0/templates/backup-postgres-config.yaml
  15. 0 0
      charts/nextcloud/1.6.0/templates/backup-postgres-hook.yaml
  16. 49 0
      charts/nextcloud/1.6.0/templates/cronjob.yaml
  17. 0 0
      charts/nextcloud/1.6.0/templates/deployment.yaml
  18. 0 0
      charts/nextcloud/1.6.0/templates/nginx-configmap.yaml
  19. 0 0
      charts/nextcloud/1.6.0/templates/nginx-secret.yaml
  20. 0 0
      charts/nextcloud/1.6.0/templates/nuke-deployments-hook.yaml
  21. 0 0
      charts/nextcloud/1.6.0/templates/postgres-deployment.yaml
  22. 0 0
      charts/nextcloud/1.6.0/templates/postgres-secret.yaml
  23. 0 0
      charts/nextcloud/1.6.0/templates/postgres-service.yaml
  24. 0 0
      charts/nextcloud/1.6.0/templates/secrets.yaml
  25. 0 0
      charts/nextcloud/1.6.0/templates/service.yaml
  26. 0 0
      charts/nextcloud/1.6.0/templates/serviceaccount.yaml
  27. 0 0
      charts/nextcloud/1.6.0/templates/tests/deployment-check.yaml
  28. 3 0
      charts/nextcloud/1.6.0/test_values.yaml
  29. 0 0
      test/nextcloud/1.6.0/.helmignore
  30. 0 0
      test/nextcloud/1.6.0/Chart.lock
  31. 1 1
      test/nextcloud/1.6.0/Chart.yaml
  32. 0 0
      test/nextcloud/1.6.0/README.md
  33. 0 0
      test/nextcloud/1.6.0/app-readme.md
  34. 0 0
      test/nextcloud/1.6.0/charts/common-2112.0.0.tgz
  35. 0 0
      test/nextcloud/1.6.0/ix_values.yaml
  36. 0 0
      test/nextcloud/1.6.0/migrations/migrate_from_1.1.0
  37. 23 0
      test/nextcloud/1.6.0/questions.yaml
  38. 0 0
      test/nextcloud/1.6.0/requirements.lock
  39. 0 0
      test/nextcloud/1.6.0/templates/NOTES.txt
  40. 0 0
      test/nextcloud/1.6.0/templates/_nginx.tpl
  41. 0 0
      test/nextcloud/1.6.0/templates/_postgres.tpl
  42. 0 0
      test/nextcloud/1.6.0/templates/backup-postgres-config.yaml
  43. 0 0
      test/nextcloud/1.6.0/templates/backup-postgres-hook.yaml
  44. 49 0
      test/nextcloud/1.6.0/templates/cronjob.yaml
  45. 0 0
      test/nextcloud/1.6.0/templates/deployment.yaml
  46. 0 0
      test/nextcloud/1.6.0/templates/nginx-configmap.yaml
  47. 0 0
      test/nextcloud/1.6.0/templates/nginx-secret.yaml
  48. 0 0
      test/nextcloud/1.6.0/templates/nuke-deployments-hook.yaml
  49. 0 0
      test/nextcloud/1.6.0/templates/postgres-deployment.yaml
  50. 0 0
      test/nextcloud/1.6.0/templates/postgres-secret.yaml
  51. 0 0
      test/nextcloud/1.6.0/templates/postgres-service.yaml
  52. 0 0
      test/nextcloud/1.6.0/templates/secrets.yaml
  53. 0 0
      test/nextcloud/1.6.0/templates/service.yaml
  54. 0 0
      test/nextcloud/1.6.0/templates/serviceaccount.yaml
  55. 0 0
      test/nextcloud/1.6.0/templates/tests/deployment-check.yaml
  56. 3 0
      test/nextcloud/1.6.0/test_values.yaml

+ 0 - 0
charts/nextcloud/1.5.2/.helmignore → charts/nextcloud/1.6.0/.helmignore


+ 0 - 0
charts/nextcloud/1.5.2/Chart.lock → charts/nextcloud/1.6.0/Chart.lock


+ 1 - 1
charts/nextcloud/1.5.2/Chart.yaml → charts/nextcloud/1.6.0/Chart.yaml

@@ -19,4 +19,4 @@ sources:
 - https://github.com/nextcloud/docker
 - https://github.com/nextcloud/helm
 upstream_version: 2.3.2
-version: 1.5.2
+version: 1.6.0

+ 0 - 0
charts/nextcloud/1.5.2/README.md → charts/nextcloud/1.6.0/README.md


+ 0 - 0
charts/nextcloud/1.5.2/app-readme.md → charts/nextcloud/1.6.0/app-readme.md


+ 0 - 0
charts/nextcloud/1.5.2/charts/common-2112.0.0.tgz → charts/nextcloud/1.6.0/charts/common-2112.0.0.tgz


+ 0 - 0
charts/nextcloud/1.5.2/ix_values.yaml → charts/nextcloud/1.6.0/ix_values.yaml


+ 0 - 0
charts/nextcloud/1.5.2/migrations/migrate_from_1.1.0 → charts/nextcloud/1.6.0/migrations/migrate_from_1.1.0


+ 23 - 0
test/nextcloud/1.5.2/questions.yaml → charts/nextcloud/1.6.0/questions.yaml

@@ -9,6 +9,8 @@ groups:
     description: "Configure nextcloud container parameters"
   - name: "Postgresql Configuration"
     description: "Configure Postgresql for nextcloud"
+  - name: "CronJob configuration"
+    description: "Configure CronJob for nextcloud"
   - name: "Scaling/Upgrade Policy"
     description: "Configure how pods are replaced when configuration is upgraded"
   - name: "Advanced DNS Settings"
@@ -100,6 +102,27 @@ questions:
             default: "/var/www/html/data"
             required: true
 
+  - variable: cronjob
+    description: "Setup cronjob for nextcloud"
+    label: "Setup cronjob for nextcloud"
+    group: "CronJob configuration"
+    schema:
+      type: dict
+      attrs:
+        - variable: enabled
+          label: "Enable cronjobs for nextcloud"
+          schema:
+            type: boolean
+            default: false
+            show_subquestions_if: true
+            subquestions:
+              - variable: schedule
+                label: Schedule
+                schema:
+                  type: string
+                  default: "1 */24 * * *"
+                  empty: false
+
   # Update strategy
   - variable: updateStrategy
     description: "Upgrade Policy"

+ 0 - 0
charts/nextcloud/1.5.2/requirements.lock → charts/nextcloud/1.6.0/requirements.lock


+ 0 - 0
charts/nextcloud/1.5.2/templates/NOTES.txt → charts/nextcloud/1.6.0/templates/NOTES.txt


+ 0 - 0
charts/nextcloud/1.5.2/templates/_nginx.tpl → charts/nextcloud/1.6.0/templates/_nginx.tpl


+ 0 - 0
charts/nextcloud/1.5.2/templates/_postgres.tpl → charts/nextcloud/1.6.0/templates/_postgres.tpl


+ 0 - 0
charts/nextcloud/1.5.2/templates/backup-postgres-config.yaml → charts/nextcloud/1.6.0/templates/backup-postgres-config.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/backup-postgres-hook.yaml → charts/nextcloud/1.6.0/templates/backup-postgres-hook.yaml


+ 49 - 0
charts/nextcloud/1.6.0/templates/cronjob.yaml

@@ -0,0 +1,49 @@
+{{ $cronjob_values := (. | mustDeepCopy) }}
+{{ $_ := set $cronjob_values "common" (dict "nameSuffix" "cronjob") }}
+
+{{ $hostName := .Values.nextcloud.host }}
+{{ if .Values.useServiceNameForHost }}
+{{ $hostName = (include "common.names.fullname" .) }}
+{{ end }}
+
+{{if .Values.cronjob.enabled }}
+apiVersion: batch/v1
+kind: CronJob
+metadata:
+  name: {{ template "common.names.fullname" $cronjob_values }}
+  labels:
+    app: {{ template "common.names.name" $cronjob_values }}
+    chart: {{ template "common.names.chart" $cronjob_values }}
+    release: {{ .Release.Name }}
+  annotations:
+    rollme: {{ randAlphaNum 5 | quote }}
+spec:
+  schedule: "{{ .Values.cronjob.schedule }}"
+  concurrencyPolicy: Forbid
+  failedJobsHistoryLimit: 2
+  successfulJobsHistoryLimit: 1
+  jobTemplate:
+    metadata:
+      labels:
+        app: {{ template "common.names.name" $cronjob_values }}
+        release: {{ .Release.Name }}
+        {{- include "common.labels.selectorLabels" $cronjob_values | nindent 8 }}
+    spec:
+      template:
+        metadata:
+          labels:
+            app: {{ template "common.names.name" $cronjob_values }}
+            release: {{ .Release.Name }}
+            {{- include "common.labels.selectorLabels" $cronjob_values | nindent 12 }}
+        spec:
+          restartPolicy: Never
+          containers:
+            - name: {{ .Chart.Name }}-cronjob
+              image: "{{.Values.image.repository }}:{{.Values.image.tag }}"
+              imagePullPolicy: {{ .Values.image.pullPolicy }}
+              {{- if .Values.certificate }}
+              command: [ "curl" ,"-k" , "https://{{ $hostName }}:{{.Values.service.nodePort}}/cron.php"]
+              {{- else }}
+              command: [ "curl" , "http://{{ $hostName }}:{{.Values.service.nodePort}}/cron.php"]
+              {{- end }}
+{{ end }}

+ 0 - 0
charts/nextcloud/1.5.2/templates/deployment.yaml → charts/nextcloud/1.6.0/templates/deployment.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/nginx-configmap.yaml → charts/nextcloud/1.6.0/templates/nginx-configmap.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/nginx-secret.yaml → charts/nextcloud/1.6.0/templates/nginx-secret.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/nuke-deployments-hook.yaml → charts/nextcloud/1.6.0/templates/nuke-deployments-hook.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/postgres-deployment.yaml → charts/nextcloud/1.6.0/templates/postgres-deployment.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/postgres-secret.yaml → charts/nextcloud/1.6.0/templates/postgres-secret.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/postgres-service.yaml → charts/nextcloud/1.6.0/templates/postgres-service.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/secrets.yaml → charts/nextcloud/1.6.0/templates/secrets.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/service.yaml → charts/nextcloud/1.6.0/templates/service.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/serviceaccount.yaml → charts/nextcloud/1.6.0/templates/serviceaccount.yaml


+ 0 - 0
charts/nextcloud/1.5.2/templates/tests/deployment-check.yaml → charts/nextcloud/1.6.0/templates/tests/deployment-check.yaml


+ 3 - 0
test/nextcloud/1.5.2/test_values.yaml → charts/nextcloud/1.6.0/test_values.yaml

@@ -39,3 +39,6 @@ service:
   nodePort: 31000
 updateStrategy: Recreate
 useServiceNameForHost: true
+cronjob:
+  enabled: false
+  schedule: "1 */24 * * *"

+ 0 - 0
test/nextcloud/1.5.2/.helmignore → test/nextcloud/1.6.0/.helmignore


+ 0 - 0
test/nextcloud/1.5.2/Chart.lock → test/nextcloud/1.6.0/Chart.lock


+ 1 - 1
test/nextcloud/1.5.2/Chart.yaml → test/nextcloud/1.6.0/Chart.yaml

@@ -19,4 +19,4 @@ sources:
 - https://github.com/nextcloud/docker
 - https://github.com/nextcloud/helm
 upstream_version: 2.3.2
-version: 1.5.2
+version: 1.6.0

+ 0 - 0
test/nextcloud/1.5.2/README.md → test/nextcloud/1.6.0/README.md


+ 0 - 0
test/nextcloud/1.5.2/app-readme.md → test/nextcloud/1.6.0/app-readme.md


+ 0 - 0
test/nextcloud/1.5.2/charts/common-2112.0.0.tgz → test/nextcloud/1.6.0/charts/common-2112.0.0.tgz


+ 0 - 0
test/nextcloud/1.5.2/ix_values.yaml → test/nextcloud/1.6.0/ix_values.yaml


+ 0 - 0
test/nextcloud/1.5.2/migrations/migrate_from_1.1.0 → test/nextcloud/1.6.0/migrations/migrate_from_1.1.0


+ 23 - 0
charts/nextcloud/1.5.2/questions.yaml → test/nextcloud/1.6.0/questions.yaml

@@ -9,6 +9,8 @@ groups:
     description: "Configure nextcloud container parameters"
   - name: "Postgresql Configuration"
     description: "Configure Postgresql for nextcloud"
+  - name: "CronJob configuration"
+    description: "Configure CronJob for nextcloud"
   - name: "Scaling/Upgrade Policy"
     description: "Configure how pods are replaced when configuration is upgraded"
   - name: "Advanced DNS Settings"
@@ -100,6 +102,27 @@ questions:
             default: "/var/www/html/data"
             required: true
 
+  - variable: cronjob
+    description: "Setup cronjob for nextcloud"
+    label: "Setup cronjob for nextcloud"
+    group: "CronJob configuration"
+    schema:
+      type: dict
+      attrs:
+        - variable: enabled
+          label: "Enable cronjobs for nextcloud"
+          schema:
+            type: boolean
+            default: false
+            show_subquestions_if: true
+            subquestions:
+              - variable: schedule
+                label: Schedule
+                schema:
+                  type: string
+                  default: "1 */24 * * *"
+                  empty: false
+
   # Update strategy
   - variable: updateStrategy
     description: "Upgrade Policy"

+ 0 - 0
test/nextcloud/1.5.2/requirements.lock → test/nextcloud/1.6.0/requirements.lock


+ 0 - 0
test/nextcloud/1.5.2/templates/NOTES.txt → test/nextcloud/1.6.0/templates/NOTES.txt


+ 0 - 0
test/nextcloud/1.5.2/templates/_nginx.tpl → test/nextcloud/1.6.0/templates/_nginx.tpl


+ 0 - 0
test/nextcloud/1.5.2/templates/_postgres.tpl → test/nextcloud/1.6.0/templates/_postgres.tpl


+ 0 - 0
test/nextcloud/1.5.2/templates/backup-postgres-config.yaml → test/nextcloud/1.6.0/templates/backup-postgres-config.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/backup-postgres-hook.yaml → test/nextcloud/1.6.0/templates/backup-postgres-hook.yaml


+ 49 - 0
test/nextcloud/1.6.0/templates/cronjob.yaml

@@ -0,0 +1,49 @@
+{{ $cronjob_values := (. | mustDeepCopy) }}
+{{ $_ := set $cronjob_values "common" (dict "nameSuffix" "cronjob") }}
+
+{{ $hostName := .Values.nextcloud.host }}
+{{ if .Values.useServiceNameForHost }}
+{{ $hostName = (include "common.names.fullname" .) }}
+{{ end }}
+
+{{if .Values.cronjob.enabled }}
+apiVersion: batch/v1
+kind: CronJob
+metadata:
+  name: {{ template "common.names.fullname" $cronjob_values }}
+  labels:
+    app: {{ template "common.names.name" $cronjob_values }}
+    chart: {{ template "common.names.chart" $cronjob_values }}
+    release: {{ .Release.Name }}
+  annotations:
+    rollme: {{ randAlphaNum 5 | quote }}
+spec:
+  schedule: "{{ .Values.cronjob.schedule }}"
+  concurrencyPolicy: Forbid
+  failedJobsHistoryLimit: 2
+  successfulJobsHistoryLimit: 1
+  jobTemplate:
+    metadata:
+      labels:
+        app: {{ template "common.names.name" $cronjob_values }}
+        release: {{ .Release.Name }}
+        {{- include "common.labels.selectorLabels" $cronjob_values | nindent 8 }}
+    spec:
+      template:
+        metadata:
+          labels:
+            app: {{ template "common.names.name" $cronjob_values }}
+            release: {{ .Release.Name }}
+            {{- include "common.labels.selectorLabels" $cronjob_values | nindent 12 }}
+        spec:
+          restartPolicy: Never
+          containers:
+            - name: {{ .Chart.Name }}-cronjob
+              image: "{{.Values.image.repository }}:{{.Values.image.tag }}"
+              imagePullPolicy: {{ .Values.image.pullPolicy }}
+              {{- if .Values.certificate }}
+              command: [ "curl" ,"-k" , "https://{{ $hostName }}:{{.Values.service.nodePort}}/cron.php"]
+              {{- else }}
+              command: [ "curl" , "http://{{ $hostName }}:{{.Values.service.nodePort}}/cron.php"]
+              {{- end }}
+{{ end }}

+ 0 - 0
test/nextcloud/1.5.2/templates/deployment.yaml → test/nextcloud/1.6.0/templates/deployment.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/nginx-configmap.yaml → test/nextcloud/1.6.0/templates/nginx-configmap.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/nginx-secret.yaml → test/nextcloud/1.6.0/templates/nginx-secret.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/nuke-deployments-hook.yaml → test/nextcloud/1.6.0/templates/nuke-deployments-hook.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/postgres-deployment.yaml → test/nextcloud/1.6.0/templates/postgres-deployment.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/postgres-secret.yaml → test/nextcloud/1.6.0/templates/postgres-secret.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/postgres-service.yaml → test/nextcloud/1.6.0/templates/postgres-service.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/secrets.yaml → test/nextcloud/1.6.0/templates/secrets.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/service.yaml → test/nextcloud/1.6.0/templates/service.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/serviceaccount.yaml → test/nextcloud/1.6.0/templates/serviceaccount.yaml


+ 0 - 0
test/nextcloud/1.5.2/templates/tests/deployment-check.yaml → test/nextcloud/1.6.0/templates/tests/deployment-check.yaml


+ 3 - 0
charts/nextcloud/1.5.2/test_values.yaml → test/nextcloud/1.6.0/test_values.yaml

@@ -39,3 +39,6 @@ service:
   nodePort: 31000
 updateStrategy: Recreate
 useServiceNameForHost: true
+cronjob:
+  enabled: false
+  schedule: "1 */24 * * *"