From 5a20f381bbe68175c73f8607d3c82a34107a5eb2 Mon Sep 17 00:00:00 2001 From: Rufus Deponian Date: Fri, 12 Apr 2024 14:22:36 +0500 Subject: [PATCH] extra-alerts: Disable PodMemoryUsageLimit alert for "kube-system" namespace --- charts/extra-alerts/CHANGELOG.md | 5 ++++- charts/extra-alerts/Chart.yaml | 2 +- .../templates/kubernetesApps/kubernetes-apps.yaml | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/charts/extra-alerts/CHANGELOG.md b/charts/extra-alerts/CHANGELOG.md index 2b542af..c547a78 100644 --- a/charts/extra-alerts/CHANGELOG.md +++ b/charts/extra-alerts/CHANGELOG.md @@ -1,4 +1,7 @@ -# 0.5.0 (29.04.2024) +# 0.6.0 (12.04.2024) +- Disable PodMemoryUsageLimit alert for "kube-system" namespace + +# 0.5.0 (09.04.2024) - Update kube-prometheus-stack to 58.0.0 # 0.4.0 (05.12.2023) diff --git a/charts/extra-alerts/Chart.yaml b/charts/extra-alerts/Chart.yaml index 78ce660..11d8eef 100644 --- a/charts/extra-alerts/Chart.yaml +++ b/charts/extra-alerts/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: extra-alerts description: A Helm chart with some tuned extra PrometheusRules from kube-prometheus-stack chart appVersion: "58.0.0" # kube-prometheus-stack version -version: 0.5.0 +version: 0.6.0 maintainers: - name: Ilya Cherepanov email: deponian@evilmartians.com diff --git a/charts/extra-alerts/templates/kubernetesApps/kubernetes-apps.yaml b/charts/extra-alerts/templates/kubernetesApps/kubernetes-apps.yaml index 61bb5a7..2c52a42 100644 --- a/charts/extra-alerts/templates/kubernetesApps/kubernetes-apps.yaml +++ b/charts/extra-alerts/templates/kubernetesApps/kubernetes-apps.yaml @@ -89,9 +89,9 @@ spec: description: 'Pod: {{`{{`}} $labels.pod {{`}}`}}, namespace: {{`{{`}} $labels.namespace {{`}}`}} memory usage {{`{{`}} printf "%.2f" $value {{`}}`}}% more than 85% of its limit for 1h' summary: Pod uses more than 85% of its memory limit. expr: |- - sum(label_replace(container_memory_working_set_bytes{container!="", namespace=~"{{ $targetNamespace }}"}, "pod", "$1", "pod", "(.*)")) by (pod, namespace) + sum(label_replace(container_memory_working_set_bytes{container!="", namespace!="kube-system", "pod", "$1", "pod", "(.*)")) by (pod, namespace) / - sum(kube_pod_container_resource_limits{resource="memory", namespace=~"{{ $targetNamespace }}"}) by (pod,namespace) * 100 > 85 + sum(kube_pod_container_resource_limits{resource="memory", namespace!="kube-system"}) by (pod,namespace) * 100 > 85 for: 60m labels: severity: warning @@ -103,9 +103,9 @@ spec: description: 'Pod: {{`{{`}} $labels.pod {{`}}`}}, namespace: {{`{{`}} $labels.namespace {{`}}`}} memory usage {{`{{`}} printf "%.2f" $value {{`}}`}}% more than 95% of its limit for 5m' summary: Pod uses more than 95% of its memory limit. expr: |- - sum(label_replace(container_memory_working_set_bytes{container!="", namespace=~"{{ $targetNamespace }}"}, "pod", "$1", "pod", "(.*)")) by (pod, namespace) + sum(label_replace(container_memory_working_set_bytes{container!="", namespace!="kube-system"}, "pod", "$1", "pod", "(.*)")) by (pod, namespace) / - sum(kube_pod_container_resource_limits{resource="memory", namespace=~"{{ $targetNamespace }}"}) by (pod,namespace) * 100 > 95 + sum(kube_pod_container_resource_limits{resource="memory", namespace!="kube-system"}) by (pod,namespace) * 100 > 95 for: 5m labels: severity: warning