Commit 74e79292 authored by Waqar Ahmed's avatar Waqar Ahmed

Clean internal/external db references

parent 8b7530d3
...@@ -158,26 +158,11 @@ questions: ...@@ -158,26 +158,11 @@ questions:
schema: schema:
type: hostpath type: hostpath
- variable: internalDatabase
label: "REMOVEME"
schema:
type: dict
additional_attrs: true
attrs: []
- variable: externalDatabase
label: "REMOVEME"
schema:
type: dict
additional_attrs: true
attrs: []
- variable: postgresql - variable: postgresql
label: "Configure Postgresql" label: "Configure Postgresql"
group: "Postgresql Configuration" group: "Postgresql Configuration"
schema: schema:
type: dict type: dict
additional_attrs: true
attrs: attrs:
- variable: backupVolume - variable: backupVolume
label: "Backup Volume" label: "Backup Volume"
...@@ -217,10 +202,3 @@ questions: ...@@ -217,10 +202,3 @@ questions:
type: string type: string
default: "ix-postgres_data" default: "ix-postgres_data"
editable: false editable: false
- variable: cronjob
label: "REMOVEME"
schema:
type: dict
additional_attrs: true
attrs: []
{{- 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 }}
resources:
{{ toYaml (default .Values.resources .Values.cronjob.resources) | indent 16 }}
{{- 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 }}
{{- if .Values.externalDatabase.enabled }}
{{- if not .Values.externalDatabase.existingSecret.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-%s" .Release.Name "db" }}
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 }}
type: Opaque
data:
db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }}
db-username: {{ default "" .Values.externalDatabase.user | b64enc | quote }}
{{- end }}
{{- end }}
\ No newline at end of file
...@@ -89,82 +89,13 @@ nextcloud: ...@@ -89,82 +89,13 @@ nextcloud:
# - name: nfs # - name: nfs
# mountPath: "/legacy_data" # mountPath: "/legacy_data"
internalDatabase:
enabled: false
name: nextcloud
##
## External database configuration
##
externalDatabase:
enabled: true
## Supported database engines: mysql or postgresql
type: postgresql
## Database host
host:
## Database user
user: nextcloud
## Database password
password:
## Database name
database: nextcloud
## Use a existing secret
existingSecret:
enabled: false
# secretName: nameofsecret
# usernameKey: username
# passwordKey: password
postgresql: postgresql:
backupVolume:
## Cronjob to execute Nextcloud background tasks mountPath: "/postgres_backups"
## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron datasetName: "ix-postgres_backups"
## dataVolume:
cronjob: mountPath: "/var/lib/postgresql/data"
enabled: false datasetName: "ix-postgres_data"
# Nexcloud image is used as default but only curl is needed
image: {}
# repository: nextcloud
# tag: 16.0.3-apache
# pullPolicy: IfNotPresent
# pullSecrets:
# - myRegistrKeySecretName
# Every 5 minutes
# Note: Setting this to any any other value than 5 minutes might
# cause issues with how nextcloud background jobs are executed
schedule: "*/5 * * * *"
annotations: {}
# Set curl's insecure option if you use e.g. self-signed certificates
curlInsecure: false
failedJobsHistoryLimit: 5
successfulJobsHistoryLimit: 2
# If not set, nextcloud deployment one will be set
# resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# If not set, nextcloud deployment one will be set
# nodeSelector: {}
# If not set, nextcloud deployment one will be set
# tolerations: []
# If not set, nextcloud deployment one will be set
# affinity: {}
service: service:
nodePort: 9000 nodePort: 9000
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment