# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 The HuggingFace Authors.

{{- if .Values.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  labels: {{ include "labels.admin" . | nindent 4 }}
  name: "{{ include "name" . }}-admin"
  namespace: {{ .Release.Namespace }}
spec:
  endpoints:
    - path: /admin/metrics
      port: http
  namespaceSelector:
    matchNames:
      - {{ .Release.Namespace }}
  selector:
    matchLabels: {{ include "labels.admin" . | nindent 6 }}
{{- end }}
