{{- if .Values.metricsService.enabled }}
---
apiVersion: v1
kind: Service
metadata:
  name: {{ include "nemo-kubernetes-operator.fullname" . }}
  {{- if .Values.restrictedNamespace }}
  namespace: {{ .Values.restrictedNamespace }}
  {{- end }}
  labels:
    app.kubernetes.io/component: kube-rbac-proxy
    app.kubernetes.io/created-by: nemo-kubernetes-operator
    app.kubernetes.io/part-of: nemo-kubernetes-operator
    control-plane: controller-manager
  {{- include "nemo-kubernetes-operator.labels" . | nindent 4 }}
spec:
  type: {{ .Values.metricsService.type }}
  selector:
    control-plane: controller-manager
  {{- include "nemo-kubernetes-operator.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.metricsService.ports | toYaml | nindent 2 -}}
{{- end }}
