# helm_charts_cert-secret.yaml
{{- if and .Values.es.ssl.enabled (eq .Values.es.ssl.useExistingSecrets false) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "elasticsearch-exporter.fullname" . }}-cert
  labels:
    chart: {{ template "elasticsearch-exporter.chart" . }}
    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 }}