rancher-charts/packages/rancher-monitoring/generated-changes/patch/templates/prometheus/rules-1.14/kubernetes-system-controlle...

36 lines
1.7 KiB
Diff

--- charts-original/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml
+++ charts/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml
@@ -4,7 +4,8 @@
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack
*/ -}}
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
-{{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create .Values.kubeControllerManager.enabled }}
+{{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }}
+{{- if (include "exporter.kubeControllerManager.enabled" .)}}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
@@ -24,13 +25,13 @@
groups:
- name: kubernetes-system-controller-manager
rules:
-{{- if .Values.kubeControllerManager.enabled }}
+{{- if (include "exporter.kubeControllerManager.enabled" .)}}
- alert: KubeControllerManagerDown
annotations:
description: KubeControllerManager has disappeared from Prometheus target discovery.
runbook_url: {{ .Values.defaultRules.runbookUrl }}alert-name-kubecontrollermanagerdown
summary: Target disappeared from Prometheus target discovery.
- expr: absent(up{job="kube-controller-manager"} == 1)
+ expr: absent(up{job="{{ include "exporter.kubeControllerManager.jobName" . }}"} == 1)
for: 15m
labels:
severity: critical
@@ -38,4 +39,5 @@
{{ toYaml .Values.defaultRules.additionalRuleLabels | indent 8 }}
{{- end }}
{{- end }}
+{{- end }}
{{- end }}
\ No newline at end of file