From 385b594e7bec5256d4183c3c677332f777a568f1 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Sun, 20 Aug 2023 00:33:13 +0200 Subject: [PATCH] move changes to _data/rules.yml --- _data/rules.yml | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/_data/rules.yml b/_data/rules.yml index a6f46d4..4adc2b0 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -1693,32 +1693,32 @@ groups: slug: kubestate-exporter doc_url: https://github.com/kubernetes/kube-state-metrics/tree/master/docs rules: - - name: Kubernetes node not ready + - name: Kubernetes Node not ready description: Node {{ $labels.node }} has been unready for a long time query: 'kube_node_status_condition{condition="Ready",status="true"} == 0' severity: critical for: 10m - - name: Kubernetes memory pressure - description: "{{ $labels.node }} has MemoryPressure condition" + - name: Kubernetes Node memory pressure + description: "Node {{ $labels.node }} has MemoryPressure condition" query: 'kube_node_status_condition{condition="MemoryPressure",status="true"} == 1' severity: critical for: 2m - - name: Kubernetes disk pressure - description: "{{ $labels.node }} has DiskPressure condition" + - name: Kubernetes Node disk pressure + description: "Node {{ $labels.node }} has DiskPressure condition" query: 'kube_node_status_condition{condition="DiskPressure",status="true"} == 1' severity: critical for: 2m - - name: Kubernetes network unavailable - description: "{{ $labels.node }} has NetworkUnavailable condition" + - name: Kubernetes Node network unavailable + description: "Node {{ $labels.node }} has NetworkUnavailable condition" query: 'kube_node_status_condition{condition="NetworkUnavailable",status="true"} == 1' severity: critical for: 2m - - name: Kubernetes out of capacity - description: "{{ $labels.node }} is out of capacity" + - name: Kubernetes Node out of pod capacity + description: "Node {{ $labels.node }} is out of pod capacity" query: 'sum by (node) ((kube_pod_status_phase{phase="Running"} == 1) + on(uid) group_left(node) (0 * kube_pod_info{pod_template_hash=""})) / sum by (node) (kube_node_status_allocatable{resource="pods"}) * 100 > 90' severity: warning for: 2m - - name: Kubernetes container oom killer + - name: Kubernetes Container oom killer description: "Container {{ $labels.container }} in pod {{ $labels.namespace }}/{{ $labels.pod }} has been OOMKilled {{ $value }} times in the last 10 minutes." query: '(kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m >= 1) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}[10m]) == 1' severity: warning @@ -1741,83 +1741,83 @@ groups: severity: warning for: 2m - name: Kubernetes Volume full in four days - description: "{{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ $value | humanize }}% is available." + description: "Volume under {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ $value | humanize }}% is available." query: 'predict_linear(kubelet_volume_stats_available_bytes[6h], 4 * 24 * 3600) < 0' severity: critical - name: Kubernetes PersistentVolume error - description: "Persistent volume is in bad state" + description: "Persistent volume {{ $labels.persistentvolume }} is in bad state" query: 'kube_persistentvolume_status_phase{phase=~"Failed|Pending", job="kube-state-metrics"} > 0' severity: critical - name: Kubernetes StatefulSet down - description: A StatefulSet went down + description: StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} went down query: 'kube_statefulset_replicas != kube_statefulset_status_replicas_ready > 0' severity: critical for: 1m - - name: Kubernetes HPA scaling ability - description: Pod is unable to scale + - name: Kubernetes HPA scale inability + description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to scale query: 'kube_horizontalpodautoscaler_status_condition{status="false", condition="AbleToScale"} == 1' severity: warning for: 2m - - name: Kubernetes HPA metric availability - description: HPA is not able to collect metrics + - name: Kubernetes HPA metrics unavailability + description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to collect metrics query: 'kube_horizontalpodautoscaler_status_condition{status="false", condition="ScalingActive"} == 1' severity: warning - - name: Kubernetes HPA scale capability - description: The maximum number of desired Pods has been hit + - name: Kubernetes HPA scale maximum + description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} has hit maximum number of desired pods query: 'kube_horizontalpodautoscaler_status_desired_replicas >= kube_horizontalpodautoscaler_spec_max_replicas' severity: info for: 2m - name: Kubernetes HPA underutilized - description: HPA is constantly at minimum replicas for 50% of the time. Potential cost saving here. + description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is constantly at minimum replicas for 50% of the time. Potential cost saving here. query: 'max(quantile_over_time(0.5, kube_horizontalpodautoscaler_status_desired_replicas[1d]) == kube_horizontalpodautoscaler_spec_min_replicas) by (horizontalpodautoscaler) > 3' # allow minimum 3 replicas running severity: info - name: Kubernetes Pod not healthy - description: Pod has been in a non-ready state for longer than 15 minutes. + description: Pod {{ $labels.namespace }}/{{ $labels.pod }} has been in a non-running state for longer than 15 minutes. query: 'sum by (namespace, pod) (kube_pod_status_phase{phase=~"Pending|Unknown|Failed"}) > 0' severity: critical for: 15m - name: Kubernetes pod crash looping - description: Pod {{ $labels.pod }} is crash looping + description: Pod {{ $labels.namespace }}/{{ $labels.pod }} is crash looping query: 'increase(kube_pod_container_status_restarts_total[1m]) > 3' severity: warning for: 2m - - name: Kubernetes ReplicasSet mismatch - description: Deployment Replicas mismatch + - name: Kubernetes ReplicaSet replicas mismatch + description: ReplicaSet {{ $labels.namespace }}/{{ $labels.replicaset }} replicas mismatch query: 'kube_replicaset_spec_replicas != kube_replicaset_status_ready_replicas' severity: warning for: 10m - name: Kubernetes Deployment replicas mismatch - description: Deployment Replicas mismatch + description: Deployment {{ $labels.namespace }}/{{ $labels.deployment }} replicas mismatch query: 'kube_deployment_spec_replicas != kube_deployment_status_replicas_available' severity: warning for: 10m - name: Kubernetes StatefulSet replicas mismatch - description: A StatefulSet does not match the expected number of replicas. + description: StatefulSet does not match the expected number of replicas. query: 'kube_statefulset_status_replicas_ready != kube_statefulset_status_replicas' severity: warning for: 10m - name: Kubernetes Deployment generation mismatch - description: A Deployment has failed but has not been rolled back. + description: Deployment {{ $labels.namespace }}/{{ $labels.deployment }} has failed but has not been rolled back. query: 'kube_deployment_status_observed_generation != kube_deployment_metadata_generation' severity: critical for: 10m - name: Kubernetes StatefulSet generation mismatch - description: A StatefulSet has failed but has not been rolled back. + description: StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} has failed but has not been rolled back. query: 'kube_statefulset_status_observed_generation != kube_statefulset_metadata_generation' severity: critical for: 10m - name: Kubernetes StatefulSet update not rolled out - description: StatefulSet update has not been rolled out. + description: StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} update has not been rolled out. query: 'max without (revision) (kube_statefulset_status_current_revision unless kube_statefulset_status_update_revision) * (kube_statefulset_replicas != kube_statefulset_status_replicas_updated)' severity: warning for: 10m - name: Kubernetes DaemonSet rollout stuck - description: Some Pods of DaemonSet are not scheduled or not ready + description: Some Pods of DaemonSet {{ $labels.namespace }}/{{ $labels.daemonset }} are not scheduled or not ready query: 'kube_daemonset_status_number_ready / kube_daemonset_status_desired_number_scheduled * 100 < 100 or kube_daemonset_status_desired_number_scheduled - kube_daemonset_status_current_number_scheduled > 0' severity: warning for: 10m - name: Kubernetes DaemonSet misscheduled - description: Some DaemonSet Pods are running where they are not supposed to run + description: Some Pods of DaemonSet {{ $labels.namespace }}/{{ $labels.daemonset }} arerunning where they are not supposed to run query: 'kube_daemonset_status_number_misscheduled > 0' severity: critical for: 1m @@ -1827,7 +1827,7 @@ groups: severity: warning comments: | Threshold should be customized for each cronjob name. - - name: Kubernetes job slow completion + - name: Kubernetes Job slow completion description: Kubernetes Job {{ $labels.namespace }}/{{ $labels.job_name }} did not complete in time. query: 'kube_job_spec_completions - kube_job_status_succeeded - kube_job_status_failed > 0' severity: critical