{{- if .Values.tls.enable -}}
apiVersion: v1
kind: Secret
metadata:
  {{- if .Values.customAnnotations }}
  annotations:
  {{- toYaml .Values.customAnnotations | nindent 4 }}
  {{- end }}
  labels:
    {{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
  name: {{ template "k8s-prometheus-adapter.fullname" . }}
  namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
type: kubernetes.io/tls
data:
  tls.crt: {{ b64enc .Values.tls.certificate }}
  tls.key: {{ b64enc .Values.tls.key }}
{{- end -}}
