Helm chart to install nextcloud in Kubernetes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

95 lines
3.7 KiB

{{- if .Values.cronjob.enabled }}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ template "nextcloud.fullname" . }}-cron
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
{{ toYaml .Values.cronjob.annotations | indent 4 }}
spec:
schedule: "{{ .Values.cronjob.schedule }}"
concurrencyPolicy: Forbid
{{- with .Values.cronjob.failedJobsHistoryLimit }}
failedJobsHistoryLimit: {{ . }}
{{- end }}
{{- with .Values.cronjob.successfulJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ . }}
{{- end }}
jobTemplate:
metadata:
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
restartPolicy: Never
{{- if (default .Values.image.pullSecrets .Values.cronjob.image.pullSecrets) }}
imagePullSecrets:
{{- range (default .Values.image.pullSecrets .Values.cronjob.image.pullSecrets) }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ default .Values.image.repository .Values.cronjob.image.repository }}:{{ default .Values.image.tag .Values.cronjob.image.tag }}"
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.cronjob.image.pullPolicy }}
command: [ "curl" ]
args:
{{- if .Values.ingress.enabled }}
{{- if .Values.cronjob.curlInsecure }}
- "-k"
{{- end }}
- "--fail"
- "-L"
{{- if .Values.ingress.tls }}
- "https://{{ .Values.nextcloud.host }}/cron.php"
{{- else }}
- "http://{{ .Values.nextcloud.host }}/cron.php"
{{- end }}
{{- else }}
- "http://{{ template "nextcloud.fullname" . }}:{{ .Values.service.port }}/cron.php"
{{- end }}
# Will mount configuration files as www-data (id: 82) for nextcloud
{{- if .Values.nginx.enabled }}
securityContext:
{{- if .Values.securityContext }}
{{- with .Values.securityContext }}
{{- toYaml . | nindent 17 }}
{{- end }}
{{- end }}
{{- else }}
# Will mount configuration files as www-data (id: 33) for nextcloud
securityContext:
{{- if .Values.securityContext }}
{{- with .Values.securityContext }}
{{- toYaml . | nindent 17 }}
{{- end }}
{{- end }}
{{- end }}
resources:
{{ toYaml (default .Values.resources .Values.cronjob.resources) | indent 16 }}
{{- if .Values.rbac.enabled }}
serviceAccountName: {{ .Values.rbac.serviceaccount.name }}
{{- end }}
{{- with (default .Values.nodeSelector .Values.cronjob.nodeSelector) }}
nodeSelector:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with (default .Values.affinity .Values.cronjob.affinity) }}
affinity:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with (default .Values.tolerations .Values.cronjob.tolerations) }}
tolerations:
{{ toYaml . | indent 12 }}
{{- end }}
{{- end }}