{{- if .Values.es.nodeSets }}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  labels:
    common.k8s.elastic.co/type: elasticsearch
    elasticsearch.k8s.elastic.co/cluster-name: {{ template "kubezero-lib.fullname" $ }}
    {{ include "kubezero-lib.labels" . | nindent 4 }}
  name: {{ template "kubezero-lib.fullname" $ }}-es-elastic-user
  namespace: {{ .Release.Namespace }}
data:
  elastic: {{ .Values.elastic_password | b64enc | quote }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  labels:
    common.k8s.elastic.co/type: elasticsearch
    elasticsearch.k8s.elastic.co/cluster-name: {{ template "kubezero-lib.fullname" $ }}
    {{ include "kubezero-lib.labels" . | nindent 4 }}
  name: {{ template "kubezero-lib.fullname" $ }}-es-elastic-username
  namespace: {{ .Release.Namespace }}
data:
  username: {{ "elastic" | b64enc | quote }}
{{- end }}