{{- if .Values.es.ssl.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "elasticsearch-exporter.fullname" . }}-cert
  labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    app: {{ template "elasticsearch-exporter.name" . }}
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  ca.pem: {{ .Values.es.ssl.ca.pem | b64enc }}
  client.pem: {{ .Values.es.ssl.client.pem | b64enc }}
  client.key: {{ .Values.es.ssl.client.key | b64enc }}
{{- end }}
