jenkins-controller-alerting-rules.yaml 1.0 KB

1234567891011121314151617181920212223242526
  1. {{- if and .Values.controller.prometheus.enabled .Values.controller.prometheus.alertingrules }}
  2. ---
  3. apiVersion: monitoring.coreos.com/v1
  4. kind: PrometheusRule
  5. metadata:
  6. name: {{ template "jenkins.fullname" . }}
  7. {{- if .Values.controller.prometheus.prometheusRuleNamespace }}
  8. namespace: {{ .Values.controller.prometheus.prometheusRuleNamespace }}
  9. {{- else }}
  10. namespace: {{ template "jenkins.namespace" . }}
  11. {{- end }}
  12. labels:
  13. "app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
  14. {{- if .Values.renderHelmLabels }}
  15. "helm.sh/chart": "{{ template "jenkins.label" .}}"
  16. {{- end }}
  17. "app.kubernetes.io/managed-by": "{{ .Release.Service }}"
  18. "app.kubernetes.io/instance": "{{ .Release.Name }}"
  19. "app.kubernetes.io/component": "{{ .Values.controller.componentName }}"
  20. {{- range $key, $val := .Values.controller.prometheus.alertingRulesAdditionalLabels }}
  21. {{ $key }}: {{ $val | quote }}
  22. {{- end}}
  23. spec:
  24. groups:
  25. {{ toYaml .Values.controller.prometheus.alertingrules | indent 2 }}
  26. {{- end }}