mirror of
https://github.com/truenas/charts.git
synced 2026-11-03 16:23:21 +00:00
Merge pull request #464 from truenas/NAS-115798
NAS-115798 / 22.12 / Add cronjobs for nextcloud app
This commit is contained in:
56 files changed
+152
-2
No files matched your search
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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"
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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 }}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -39,3 +39,6 @@ service:
|
||||
nodePort: 31000
|
||||
updateStrategy: Recreate
|
||||
useServiceNameForHost: true
|
||||
cronjob:
|
||||
enabled: false
|
||||
schedule: "1 */24 * * *"
|
||||
Reference in new issue
Block a user