47 lines
2.0 KiB
Smarty
47 lines
2.0 KiB
Smarty
{{- define "helm_keep_annotation" -}}
|
|
"helm.sh/resource-policy": keep
|
|
{{- end -}}
|
|
|
|
{{/* Generated Postgres Config */}}
|
|
{{ define "POSTGRES_NAME" }}{{ printf "%s-postgres" .Release.Name | lower }}{{ end }}
|
|
{{ define "POSTGRES_DB" }}nextcloud{{ end }}
|
|
{{ define "DATABASE_HOST" }}{{ .Release.Name }}-postgres{{ end }}
|
|
{{ define "POSTGRES_USER" }}postgres{{ end }}
|
|
|
|
{{/* Generated Nextcloud Config */}}
|
|
{{ define "NEXTCLOUD_NAME" }}{{ printf "%s-nextcloud" .Release.Name | lower }}{{ end }}
|
|
{{ define "ADMIN_USER" }}admin{{ end }}
|
|
|
|
{{/* Generated Redis Config */}}
|
|
{{ define "REDIS_NAME" }}{{ printf "%s-redis" .Release.Name | lower }}{{ end }}
|
|
{{ define "REDIS_HOST" }}{{ .Release.Name }}-redis{{ end }}
|
|
|
|
{{/* Postgres password lookup - uses existing password if possible */}}
|
|
{{ define "POSTGRES_PASSWORD" -}}
|
|
{{- $POSTGRES_SECRET := (lookup "v1" "Secret" .Release.Namespace ( include "POSTGRES_NAME" . )).data -}}
|
|
{{- if $POSTGRES_SECRET -}}
|
|
{{- printf $POSTGRES_SECRET.POSTGRES_PASSWORD | b64enc -}}
|
|
{{- else -}}
|
|
{{- printf (required ".Values.postgres.password is required" .Values.postgres.password) | b64enc -}}
|
|
{{- end -}}
|
|
{{- end }}
|
|
|
|
{{/* Nextcloud admin password lookup - uses existing password if possible */}}
|
|
{{ define "NEXTCLOUD_ADMIN_PASSWORD" -}}
|
|
{{- $NEXTCLOUD_SECRETS := (lookup "v1" "Secret" .Release.Namespace ( include "NEXTCLOUD_NAME" . )).data -}}
|
|
{{- if $NEXTCLOUD_SECRETS -}}
|
|
{{- printf $NEXTCLOUD_SECRETS.NEXTCLOUD_ADMIN_PASSWORD | b64enc -}}
|
|
{{- else -}}
|
|
{{- printf (required ".Values.nextcloud.admin.password is required" .Values.nextcloud.admin.password) | b64enc -}}
|
|
{{- end -}}
|
|
{{- end }}
|
|
|
|
{{/* Redis password lookup - uses existing password if possible */}}
|
|
{{ define "REDIS_PASSWORD" -}}
|
|
{{- $REDIS_SECRETS := (lookup "v1" "Secret" .Release.Namespace ( include "REDIS_NAME" . )).data -}}
|
|
{{- if $REDIS_SECRETS -}}
|
|
{{- printf $REDIS_SECRETS.REDIS_PASSWORD | b64enc -}}
|
|
{{- else -}}
|
|
{{- printf (required ".Values.redis.password is required" .Values.redis.password) | b64enc -}}
|
|
{{- end -}}
|
|
{{- end }} |