{{- if .Values.tls.enable -}}
apiVersion: v1
kind: Secret
metadata:
  label:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.fullname" . }}
type: kubernetes.io/tls
data:
  tls.crt: {{ b64enc .Values.tls.certificate }}
  tls.key: {{ b64enc .Values.tls.key }}
{{- end -}}
