{{- if and .Values.kubeScheduler.enabled .Values.kubeScheduler.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
  name: {{ template "prometheus-operator.fullname" . }}-kube-scheduler
  labels:
    app: {{ template "prometheus-operator.name" . }}-kube-scheduler
    k8s-app: kube-scheduler
{{ include "prometheus-operator.labels" . | indent 4 }}
  namespace: kube-system
subsets:
  - addresses:
      {{- range .Values.kubeScheduler.endpoints }}
      - ip: {{ . }}
      {{- end }}
    ports:
      - name: http-metrics
        port: {{ .Values.kubeScheduler.service.port }}
        protocol: TCP
{{- end }}
