flux-charts/mycloud-services/templates/postgresql/release.yaml

51 lines
1.7 KiB
YAML

---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: mycloud-services-postgresql
spec:
chart:
spec:
sourceRef:
kind: GitRepository
name: "wrenix-helm-charts"
namespace: "flux-system"
chart: "./postgresql"
reconcileStrategy: "Revision"
releaseName: mycloud-services-postgresql
install:
{{- toYaml .Values.commons.helm.release.install | nindent 4 }}
test:
{{- toYaml .Values.commons.helm.release.test | nindent 4 }}
upgrade:
{{- toYaml .Values.commons.helm.release.upgrade | nindent 4 }}
driftDetection:
{{- toYaml .Values.commons.helm.release.driftDetection | nindent 4 }}
interval: 10m
valuesFrom:
- kind: Secret
name: mycloud-services-postgresql
values:
persistence:
size: {{ .Values.postgresql.persistence.size }}
{{- with .Values.postgresql.persistence.storageClass | default .Values.commons.persistence.storageClass }}
storageClass: {{ . }}
{{- end }}
{{- if .Values.commons.persistence.hostPath.enabled }}
hostPath: "{{ .Values.commons.persistence.hostPath.prefix }}/services/postgresql"
{{- end }}
postgres:
password: {{ .Values.postgresql.password | default (derivePassword 1 "long" .Values.commons.masterPassword "services" "postgresql_password") | quote }}
job:
databases:
{{- range $database, $config := .Values.databases }}
{{- if (eq $config.type "postgresql") }}
{{ $database }}:
owner: {{ $config.username | default $database }}
{{- with $config.additionalParams }}
additionalParams: {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}