{{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.existingSecret) (not .Values.postgresql.auth.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "hapi-fhir-jpaserver.fullname" . }}-external-db
  labels:
    {{- include "hapi-fhir-jpaserver.labels" . | nindent 4 }}
type: Opaque
data:
  postgres-password: {{ .Values.externalDatabase.password | b64enc | quote }}
{{- end }}
