{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "cert-manager.fullname" . }}
  namespace: {{ .Release.Namespace | quote }}
  labels:
    app: {{ include "cert-manager.name" . }}
    app.kubernetes.io/name: {{ include "cert-manager.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/component: "controller"
    helm.sh/chart: {{ include "cert-manager.chart" . }}
spec:
  type: ClusterIP
  ports:
    - protocol: TCP
      port: 9402
      targetPort: {{ .Values.prometheus.servicemonitor.targetPort }}
  selector:
    app.kubernetes.io/name: {{ include "cert-manager.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/component: "controller"
{{- end }}
