move changes to _data/rules.yml

This commit is contained in:
Samuel Berthe 2023-08-20 00:33:13 +02:00 committed by GitHub
parent 0b53b1c105
commit 385b594e7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1693,32 +1693,32 @@ groups:
slug: kubestate-exporter slug: kubestate-exporter
doc_url: https://github.com/kubernetes/kube-state-metrics/tree/master/docs doc_url: https://github.com/kubernetes/kube-state-metrics/tree/master/docs
rules: rules:
- name: Kubernetes node not ready - name: Kubernetes Node not ready
description: Node {{ $labels.node }} has been unready for a long time description: Node {{ $labels.node }} has been unready for a long time
query: 'kube_node_status_condition{condition="Ready",status="true"} == 0' query: 'kube_node_status_condition{condition="Ready",status="true"} == 0'
severity: critical severity: critical
for: 10m for: 10m
- name: Kubernetes memory pressure - name: Kubernetes Node memory pressure
description: "{{ $labels.node }} has MemoryPressure condition" description: "Node {{ $labels.node }} has MemoryPressure condition"
query: 'kube_node_status_condition{condition="MemoryPressure",status="true"} == 1' query: 'kube_node_status_condition{condition="MemoryPressure",status="true"} == 1'
severity: critical severity: critical
for: 2m for: 2m
- name: Kubernetes disk pressure - name: Kubernetes Node disk pressure
description: "{{ $labels.node }} has DiskPressure condition" description: "Node {{ $labels.node }} has DiskPressure condition"
query: 'kube_node_status_condition{condition="DiskPressure",status="true"} == 1' query: 'kube_node_status_condition{condition="DiskPressure",status="true"} == 1'
severity: critical severity: critical
for: 2m for: 2m
- name: Kubernetes network unavailable - name: Kubernetes Node network unavailable
description: "{{ $labels.node }} has NetworkUnavailable condition" description: "Node {{ $labels.node }} has NetworkUnavailable condition"
query: 'kube_node_status_condition{condition="NetworkUnavailable",status="true"} == 1' query: 'kube_node_status_condition{condition="NetworkUnavailable",status="true"} == 1'
severity: critical severity: critical
for: 2m for: 2m
- name: Kubernetes out of capacity - name: Kubernetes Node out of pod capacity
description: "{{ $labels.node }} is out of 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' 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 severity: warning
for: 2m 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." 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' 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 severity: warning
@ -1741,83 +1741,83 @@ groups:
severity: warning severity: warning
for: 2m for: 2m
- name: Kubernetes Volume full in four days - 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' query: 'predict_linear(kubelet_volume_stats_available_bytes[6h], 4 * 24 * 3600) < 0'
severity: critical severity: critical
- name: Kubernetes PersistentVolume error - 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' query: 'kube_persistentvolume_status_phase{phase=~"Failed|Pending", job="kube-state-metrics"} > 0'
severity: critical severity: critical
- name: Kubernetes StatefulSet down - 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' query: 'kube_statefulset_replicas != kube_statefulset_status_replicas_ready > 0'
severity: critical severity: critical
for: 1m for: 1m
- name: Kubernetes HPA scaling ability - name: Kubernetes HPA scale inability
description: Pod is unable to scale description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to scale
query: 'kube_horizontalpodautoscaler_status_condition{status="false", condition="AbleToScale"} == 1' query: 'kube_horizontalpodautoscaler_status_condition{status="false", condition="AbleToScale"} == 1'
severity: warning severity: warning
for: 2m for: 2m
- name: Kubernetes HPA metric availability - name: Kubernetes HPA metrics unavailability
description: HPA is not able to collect metrics description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to collect metrics
query: 'kube_horizontalpodautoscaler_status_condition{status="false", condition="ScalingActive"} == 1' query: 'kube_horizontalpodautoscaler_status_condition{status="false", condition="ScalingActive"} == 1'
severity: warning severity: warning
- name: Kubernetes HPA scale capability - name: Kubernetes HPA scale maximum
description: The maximum number of desired Pods has been hit description: HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} has hit maximum number of desired pods
query: 'kube_horizontalpodautoscaler_status_desired_replicas >= kube_horizontalpodautoscaler_spec_max_replicas' query: 'kube_horizontalpodautoscaler_status_desired_replicas >= kube_horizontalpodautoscaler_spec_max_replicas'
severity: info severity: info
for: 2m for: 2m
- name: Kubernetes HPA underutilized - 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 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 severity: info
- name: Kubernetes Pod not healthy - 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' query: 'sum by (namespace, pod) (kube_pod_status_phase{phase=~"Pending|Unknown|Failed"}) > 0'
severity: critical severity: critical
for: 15m for: 15m
- name: Kubernetes pod crash looping - 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' query: 'increase(kube_pod_container_status_restarts_total[1m]) > 3'
severity: warning severity: warning
for: 2m for: 2m
- name: Kubernetes ReplicasSet mismatch - name: Kubernetes ReplicaSet replicas mismatch
description: Deployment Replicas mismatch description: ReplicaSet {{ $labels.namespace }}/{{ $labels.replicaset }} replicas mismatch
query: 'kube_replicaset_spec_replicas != kube_replicaset_status_ready_replicas' query: 'kube_replicaset_spec_replicas != kube_replicaset_status_ready_replicas'
severity: warning severity: warning
for: 10m for: 10m
- name: Kubernetes Deployment replicas mismatch - 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' query: 'kube_deployment_spec_replicas != kube_deployment_status_replicas_available'
severity: warning severity: warning
for: 10m for: 10m
- name: Kubernetes StatefulSet replicas mismatch - 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' query: 'kube_statefulset_status_replicas_ready != kube_statefulset_status_replicas'
severity: warning severity: warning
for: 10m for: 10m
- name: Kubernetes Deployment generation mismatch - 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' query: 'kube_deployment_status_observed_generation != kube_deployment_metadata_generation'
severity: critical severity: critical
for: 10m for: 10m
- name: Kubernetes StatefulSet generation mismatch - 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' query: 'kube_statefulset_status_observed_generation != kube_statefulset_metadata_generation'
severity: critical severity: critical
for: 10m for: 10m
- name: Kubernetes StatefulSet update not rolled out - 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)' 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 severity: warning
for: 10m for: 10m
- name: Kubernetes DaemonSet rollout stuck - 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' 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 severity: warning
for: 10m for: 10m
- name: Kubernetes DaemonSet misscheduled - 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' query: 'kube_daemonset_status_number_misscheduled > 0'
severity: critical severity: critical
for: 1m for: 1m
@ -1827,7 +1827,7 @@ groups:
severity: warning severity: warning
comments: | comments: |
Threshold should be customized for each cronjob name. 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. 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' query: 'kube_job_spec_completions - kube_job_status_succeeded - kube_job_status_failed > 0'
severity: critical severity: critical