{{- if not .Values.existingSecret -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "gcloud-sqlproxy.fullname" . }}
  labels:
    app: {{ template "gcloud-sqlproxy.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  credentials.json: |-
    {{ .Values.serviceAccountKey }}
{{- end -}}