postgres-secret.yaml 432 B

12345678910111213
  1. apiVersion: v1
  2. kind: Secret
  3. metadata:
  4. name: db-details
  5. data:
  6. db-user: postgres
  7. {{- if .Release.IsInstall }}
  8. db-password: {{ randAlphaNum 15 | b64enc | quote }}
  9. {{ else }}
  10. # `index` function is necessary because the property name contains a dash.
  11. # Otherwise (...).data.db_password would have worked too.
  12. db-password: {{ index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password" }}
  13. {{ end }}