{{- if and .Values.prometheus.enabled .Values.prometheus.additionalPrometheusRules}}
apiVersion: v1
kind: List
items:
{{- range .Values.prometheus.additionalPrometheusRules }}
  - apiVersion: monitoring.coreos.com/v1
    kind: PrometheusRule
    metadata:
      name: {{ template "kube-prometheus.name" $ }}-{{ .name }}
      namespace: {{ $.Release.Namespace }}
      labels: {{ include "kube-prometheus.prometheus.labels" $ | nindent 8 }}
    spec:
      groups:
{{ toYaml .groups| indent 8 }}
{{- end }}
{{- end }}
