prometheusrule.yaml 1.1 KB

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