From 86ff8547d5e1cbe192314b55b85b277dce5d6bcc Mon Sep 17 00:00:00 2001 From: groundhog2k <10630407+groundhog2k@users.noreply.github.com> Date: Tue, 24 Nov 2020 17:28:16 +0100 Subject: [PATCH] Improved cron jobs and default database delay (#75) --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 6 +++++- charts/nextcloud/templates/cronjobs.yaml | 13 +++++++++++-- charts/nextcloud/templates/defaultcronjobs.yaml | 13 +++++++++++-- charts/nextcloud/values.yaml | 10 +++++++++- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 03355f59..1271d1d6 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -8,7 +8,7 @@ maintainers: - name: groundhog2k # This is the chart version. -version: 0.2.1 +version: 0.2.2 # This is the version number of the application being deployed. appVersion: "20.0.2-apache" diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index dd73df47..cf5dac55 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -1,6 +1,6 @@ # Nextcloud -   +   A Helm chart for Nextcloud on Kubernetes @@ -93,6 +93,10 @@ $ helm uninstall my-release | cronJobs[].name | string | `nil` | Name of the cron job | | cronJobs[].schedule | string | `nil` | Schedule for the cron job | | cronJobs[].command | string | `nil` | Command for planned execution | +| cronJobs[].affinity | object | `{}` | Affinity for pod assignment | +| cronJobs[].tolerations | list | `[]` | Tolerations for pod assignment | +| cronJobs[].nodeSelector | object | `{}` | Deployment node selector | +| cronJobs[].resources | object | `{}` | Resource limits and requests | ## Service paramters diff --git a/charts/nextcloud/templates/cronjobs.yaml b/charts/nextcloud/templates/cronjobs.yaml index d90bf323..3febc677 100644 --- a/charts/nextcloud/templates/cronjobs.yaml +++ b/charts/nextcloud/templates/cronjobs.yaml @@ -48,15 +48,24 @@ spec: name: tmp - mountPath: /var/run name: run + resources: + {{- toYaml $job.resources | nindent 18 }} + {{- if $job.nodeSelector -}} + {{- with $job.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- else }} {{- with $.Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.affinity }} + {{- end }} + {{- with $job.affinity }} affinity: {{- toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.tolerations }} + {{- with $job.tolerations }} tolerations: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/nextcloud/templates/defaultcronjobs.yaml b/charts/nextcloud/templates/defaultcronjobs.yaml index 5364066b..2b697ab5 100644 --- a/charts/nextcloud/templates/defaultcronjobs.yaml +++ b/charts/nextcloud/templates/defaultcronjobs.yaml @@ -48,15 +48,24 @@ spec: name: tmp - mountPath: /var/run name: run + resources: + {{- toYaml $job.resources | nindent 18 }} + {{- if $job.nodeSelector -}} + {{- with $job.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- else }} {{- with $.Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.affinity }} + {{- end }} + {{- with $job.affinity }} affinity: {{- toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.tolerations }} + {{- with $job.tolerations }} tolerations: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index f39d7704..badd1eae 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -24,12 +24,20 @@ defaultCronJobs: - name: cronphp schedule: "*/5 * * * *" command: "php -f /var/www/html/cron.php" + nodeSelector: {} + tolerations: [] + affinity: {} + resources: {} ## Additional cron jobs cronJobs: # - name: imagepregen # schedule: "*/30 * * * *" # command: "php -f /var/www/html/occ preview:pre-generate" +# nodeSelector: {} +# tolerations: [] +# affinity: {} +# resources: {} ## Number of replicas replicas: 1 @@ -165,7 +173,7 @@ settings: ## Enable update processing (default: false - set to true when "helm upgrade .." is used) update: false ## Delay before database update steps are initiated (default: 30 seconds) - databaseUpdateDelay: 30 + databaseUpdateDelay: 480 ## Maximum file upload size (default: 64M) maxFileUploadSize: 64M ## PHP memory limit (default: 512M) -- GitLab