{{- if and .Values.externalEtcd.user (and (not .Values.etcd.enabled) (not .Values.externalEtcd.existingSecret)) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "apisix.etcd.secretName" . }}
  namespace: {{ .Release.Namespace }}
type: Opaque
data:
  {{ .Values.externalEtcd.secretPasswordKey }}: {{ .Values.externalEtcd.password | b64enc | quote }}
{{- end }}
