{{- if .Values.createCert }}
apiVersion: v1
kind: Secret
type: kubernetes.io/tls
metadata:
  name: {{ template "elasticsearch.uname" . }}-certs
  labels:
    app: {{ template "elasticsearch.uname" . }}
    chart: "{{ .Chart.Name }}"
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
data:
{{ ( include "elasticsearch.gen-certs" . ) | indent 2 }}
{{- end }}
