The environment variables for the Paperless-NGX deployment have been refactored and moved into the main container section within the Kubernetes deployment manifest. This change organizes the environment variable definitions, enhancing readability and maintainability. Key modifications include: - Moved the `env` section under `containers.main`, allowing for a clearer structure. - Retained the logic for PostgreSQL, MariaDB, and Redis database configuration while ensuring environment variables are set within the context of the main application container. This change does not introduce any breaking functionality, but it does improve the clarity and intent of the configuration.
56 lines
2.2 KiB
YAML
56 lines
2.2 KiB
YAML
{{/* Append the hardcoded settings */}}
|
|
{{- define "healthchecks.harcodedValues" -}}
|
|
controllers:
|
|
main:
|
|
type: deployment
|
|
containers:
|
|
main:
|
|
env:
|
|
PAPERLESS_TIME_ZONE: {{ .Values.env.TZ }}
|
|
PAPERLESS_PORT: {{ quote .Values.service.main.ports.http.port }}
|
|
|
|
{{- with .Values.ingress.main }}
|
|
{{- if and .enabled .hosts }}
|
|
PAPERLESS_URL: http{{ if .tls }}s{{ end }}://{{ (first .hosts).host }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.postgresql.enabled }}
|
|
{{- with .Values.postgresql }}
|
|
PAPERLESS_DBENGINE: postgresql
|
|
PAPERLESS_DBHOST: {{ $.Release.Name }}-postgresql
|
|
PAPERLESS_DBNAME: {{ .auth.database }}
|
|
PAPERLESS_DBUSER: {{ default "postgres" .auth.username }}
|
|
PAPERLESS_DBPASS:
|
|
secretKeyRef:
|
|
name: {{ .auth.existingSecret | default (printf "%s-postgresql" $.Release.Name) }}
|
|
key: {{ if not .auth.password }}postgres-{{ end }}password
|
|
{{- end }}
|
|
{{- else if .Values.mariadb.enabled }}
|
|
{{- with .Values.mariadb}}
|
|
PAPERLESS_DBENGINE: mariadb
|
|
PAPERLESS_DBHOST: {{ $.Release.Name }}-mariadb
|
|
PAPERLESS_DBNAME: {{ .auth.database }}
|
|
PAPERLESS_DBUSER: {{ .auth.username }}
|
|
PAPERLESS_DBPASS:
|
|
secretKeyRef:
|
|
name: {{ .auth.existingSecret | default (printf "%s-mariadb" $.Release.Name) }}
|
|
key: mariadb-password
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.redis.enabled }}
|
|
{{- with .Values.redis }}
|
|
A_REDIS_PASSWORD:
|
|
secretKeyRef:
|
|
name: {{ .auth.existingSecret | default (printf "%s-redis" $.Release.Name) }}
|
|
key: {{ .auth.existingSecretPasswordKey | default "redis-password" }}
|
|
PAPERLESS_REDIS: redis://{{ .auth.username }}:$(A_REDIS_PASSWORD)@{{ $.Release.Name }}-redis-master
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
{{- $_ := merge .Values (include "healthchecks.harcodedValues" . | fromYaml) -}}
|
|
|
|
{{/* Render the templates */}}
|
|
{{ include "bjw-s.common.loader.all" . }}
|