prometheusrule.yaml 1.1 KB

12345678910111213141516171819202122232425
  1. {{- /*
  2. Copyright VMware, Inc.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
  6. {{- $releaseNamespace := default (include "common.names.namespace" .) .Values.metrics.prometheusRule.namespace }}
  7. apiVersion: monitoring.coreos.com/v1
  8. kind: PrometheusRule
  9. metadata:
  10. name: {{ include "common.names.fullname" . }}
  11. namespace: {{ $releaseNamespace | quote }}
  12. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  13. app.kubernetes.io/component: metrics
  14. {{- if .Values.metrics.prometheusRule.additionalLabels }}
  15. {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $ ) | nindent 4 }}
  16. {{- end }}
  17. {{- if .Values.commonAnnotations }}
  18. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  19. {{- end }}
  20. spec:
  21. groups:
  22. - name: {{ include "common.names.fullname" . }}
  23. rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 6 }}
  24. {{- end }}