diff --git a/deploy/chart/databases/templates/pgsql/pgsql-deployment.yaml b/deploy/chart/databases/templates/pgsql/pgsql-deployment.yaml index 15fbff6f6bd918951f5588022ea3e2aa88d91539..df8cee794e1095a1fde7ce5e5542750fc290cf64 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql-deployment.yaml +++ b/deploy/chart/databases/templates/pgsql/pgsql-deployment.yaml @@ -44,10 +44,16 @@ spec: volumeMounts: - mountPath: /var/lib/postgresql/data name: pgsql-data + - mountPath: /docker-entrypoint-initdb.d/init.sql + name: pgsql-init + subPath: init.sql resources: {{- toYaml .Values.databases.pgsql.resources | nindent 12 }} volumes: - name: pgsql-data persistentVolumeClaim: claimName: pgsql-pvc-{{ .Release.Name }} + - name: pgsql-init + secret: + secretName: pgsql-secret-{{ .Release.Name }} {{- end }} diff --git a/deploy/chart/databases/templates/pgsql/pgsql-secret.yaml b/deploy/chart/databases/templates/pgsql/pgsql-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a3b3c45c2ffad7e85df5af430c656575dd7bf821 --- /dev/null +++ b/deploy/chart/databases/templates/pgsql/pgsql-secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.databases.pgsql.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: pgsql-secret-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +type: Opaque +stringData: + init.sql: | +{{ tpl (.Files.Get "configs/pgsql/init.sql") . | indent 4 }} +{{- end }}