{{- if .Values.configs.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cortex.configsFullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "cortex.configsLabels" . | nindent 4 }}
    {{- with .Values.configs.service.labels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  annotations:
    {{- toYaml .Values.configs.service.annotations | nindent 4 }}
spec:
  type: ClusterIP
  ports:
    - port: {{ .Values.config.server.http_listen_port }}
      protocol: TCP
      name: http-metrics
      targetPort: http-metrics
  selector:
    {{- include "cortex.configsSelectorLabels" . | nindent 4 }}
{{- end }}
