Skip to content

Commit

Permalink
Publish
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Aug 19, 2023
1 parent 6b16852 commit 4279ded
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions dist/rules/kubernetes/kubestate-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes Node not ready (node {{ $labels.node }})
summary: Kubernetes Node not ready (instance {{ $labels.instance }})
description: "Node {{ $labels.node }} has been unready for a long time\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesNodeMemoryPressure
Expand All @@ -19,7 +19,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes Node memory pressure (node {{ $labels.node }})
summary: Kubernetes Node memory pressure (instance {{ $labels.instance }})
description: "Node {{ $labels.node }} has MemoryPressure condition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesNodeDiskPressure
Expand All @@ -28,7 +28,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes Node disk pressure (node {{ $labels.node }})
summary: Kubernetes Node disk pressure (instance {{ $labels.instance }})
description: "Node {{ $labels.node }} has DiskPressure condition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesNodeNetworkUnavailable
Expand All @@ -37,7 +37,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes Node network unavailable (node {{ $labels.node }})
summary: Kubernetes Node network unavailable (instance {{ $labels.instance }})
description: "Node {{ $labels.node }} has NetworkUnavailable condition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesNodeOutOfPodCapacity
Expand All @@ -46,16 +46,16 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes Node out of pod capacity (node {{ $labels.node }})
summary: Kubernetes Node out of pod capacity (instance {{ $labels.instance }})
description: "Node {{ $labels.node }} is out of pod capacity\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesContainerOomKilled
- alert: KubernetesContainerOomKiller
expr: '(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'
for: 0m
labels:
severity: warning
annotations:
summary: Kubernetes Container oom killed (pod {{ $labels.pod }})
summary: Kubernetes Container oom killer (instance {{ $labels.instance }})
description: "Container {{ $labels.container }} in pod {{ $labels.namespace }}/{{ $labels.pod }} has been OOMKilled {{ $value }} times in the last 10 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesJobFailed
Expand All @@ -64,7 +64,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes Job failed (job_name {{ $labels.job_name }})
summary: Kubernetes Job failed (instance {{ $labels.instance }})
description: "Job {{ $labels.namespace }}/{{ $labels.job_name }} failed to complete\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesCronjobSuspended
Expand All @@ -73,7 +73,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes CronJob suspended (cronjob {{ $labels.cronjob }})
summary: Kubernetes CronJob suspended (instance {{ $labels.instance }})
description: "CronJob {{ $labels.namespace }}/{{ $labels.cronjob }} is suspended\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesPersistentvolumeclaimPending
Expand All @@ -82,7 +82,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes PersistentVolumeClaim pending (pvc {{ $labels.persistentvolumeclaim }})
summary: Kubernetes PersistentVolumeClaim pending (instance {{ $labels.instance }})
description: "PersistentVolumeClaim {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is pending\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesVolumeOutOfDiskSpace
Expand All @@ -91,16 +91,16 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes Volume out of disk space (pvc {{ $labels.persistentvolumeclaim }})
description: "Volume under {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is almost full (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
summary: Kubernetes Volume out of disk space (instance {{ $labels.instance }})
description: "Volume is almost full (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesVolumeFullInFourDays
expr: 'predict_linear(kubelet_volume_stats_available_bytes[6h], 4 * 24 * 3600) < 0'
for: 0m
labels:
severity: critical
annotations:
summary: Kubernetes Volume full in four days (pvc {{ $labels.persistentvolumeclaim }})
summary: Kubernetes Volume full in four days (instance {{ $labels.instance }})
description: "Volume under {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ $value | humanize }}% is available.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesPersistentvolumeError
Expand All @@ -109,7 +109,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes PersistentVolume error (pv {{ $labels.persistentvolume }})
summary: Kubernetes PersistentVolume error (instance {{ $labels.instance }})
description: "Persistent volume {{ $labels.persistentvolume }} is in bad state\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesStatefulsetDown
Expand All @@ -118,7 +118,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes StatefulSet down (statefulset {{ $labels.statefulset }})
summary: Kubernetes StatefulSet down (instance {{ $labels.instance }})
description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} went down\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesHpaScaleInability
Expand All @@ -127,7 +127,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes HPA scale inability (hpa {{ $labels.horizontalpodautoscaler }})
summary: Kubernetes HPA scale inability (instance {{ $labels.instance }})
description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to scale\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesHpaMetricsUnavailability
Expand All @@ -136,17 +136,16 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes HPA metrics unavailability (hpa {{ $labels.horizontalpodautoscaler }})
summary: Kubernetes HPA metrics unavailability (instance {{ $labels.instance }})
description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to collect metrics\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"


- alert: KubernetesHpaScaleMaximum
expr: 'kube_horizontalpodautoscaler_status_desired_replicas >= kube_horizontalpodautoscaler_spec_max_replicas'
for: 2m
labels:
severity: info
annotations:
summary: Kubernetes HPA scale maximum (hpa {{ $labels.horizontalpodautoscaler }})
summary: Kubernetes HPA scale maximum (instance {{ $labels.instance }})
description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} has hit maximum number of desired pods\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesHpaUnderutilized
Expand All @@ -155,7 +154,7 @@ groups:
labels:
severity: info
annotations:
summary: Kubernetes HPA underutilized (hpa {{ $labels.horizontalpodautoscaler }})
summary: Kubernetes HPA underutilized (instance {{ $labels.instance }})
description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is constantly at minimum replicas for 50% of the time. Potential cost saving here.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesPodNotHealthy
Expand All @@ -164,7 +163,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes Pod not healthy (pod {{ $labels.pod }})
summary: Kubernetes Pod not healthy (instance {{ $labels.instance }})
description: "Pod {{ $labels.namespace }}/{{ $labels.pod }} has been in a non-running state for longer than 15 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesPodCrashLooping
Expand All @@ -173,7 +172,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes pod crash looping (pod {{ $labels.pod }})
summary: Kubernetes pod crash looping (instance {{ $labels.instance }})
description: "Pod {{ $labels.namespace }}/{{ $labels.pod }} is crash looping\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesReplicasetReplicasMismatch
Expand All @@ -182,7 +181,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes ReplicaSet replicas mismatch (replicaset {{ $labels.replicaset }})
summary: Kubernetes ReplicaSet replicas mismatch (instance {{ $labels.instance }})
description: "ReplicaSet {{ $labels.namespace }}/{{ $labels.replicaset }} replicas mismatch\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesDeploymentReplicasMismatch
Expand All @@ -191,7 +190,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes Deployment replicas mismatch (deployment {{ $labels.deployment }})
summary: Kubernetes Deployment replicas mismatch (instance {{ $labels.instance }})
description: "Deployment {{ $labels.namespace }}/{{ $labels.deployment }} replicas mismatch\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesStatefulsetReplicasMismatch
Expand All @@ -200,16 +199,16 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes StatefulSet replicas mismatch (statefulset {{ $labels.statefulset }})
description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} replicas mismatch\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
summary: Kubernetes StatefulSet replicas mismatch (instance {{ $labels.instance }})
description: "StatefulSet does not match the expected number of replicas.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesDeploymentGenerationMismatch
expr: 'kube_deployment_status_observed_generation != kube_deployment_metadata_generation'
for: 10m
labels:
severity: critical
annotations:
summary: Kubernetes Deployment generation mismatch (deployment {{ $labels.deployment }})
summary: Kubernetes Deployment generation mismatch (instance {{ $labels.instance }})
description: "Deployment {{ $labels.namespace }}/{{ $labels.deployment }} has failed but has not been rolled back.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesStatefulsetGenerationMismatch
Expand All @@ -218,7 +217,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes StatefulSet generation mismatch (statefulset {{ $labels.statefulset }})
summary: Kubernetes StatefulSet generation mismatch (instance {{ $labels.instance }})
description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} has failed but has not been rolled back.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesStatefulsetUpdateNotRolledOut
Expand All @@ -227,7 +226,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes StatefulSet update not rolled out (statefulset {{ $labels.statefulset }})
summary: Kubernetes StatefulSet update not rolled out (instance {{ $labels.instance }})
description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} update has not been rolled out.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesDaemonsetRolloutStuck
Expand All @@ -236,7 +235,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes DaemonSet rollout stuck (daemonset {{ $labels.daemonset }})
summary: Kubernetes DaemonSet rollout stuck (instance {{ $labels.instance }})
description: "Some Pods of DaemonSet {{ $labels.namespace }}/{{ $labels.daemonset }} are not scheduled or not ready\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesDaemonsetMisscheduled
Expand All @@ -245,7 +244,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes DaemonSet misscheduled (daemonset {{ $labels.daemonset }})
summary: Kubernetes DaemonSet misscheduled (instance {{ $labels.instance }})
description: "Some Pods of DaemonSet {{ $labels.namespace }}/{{ $labels.daemonset }} are running where they are not supposed to run\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesCronjobTooLong
Expand All @@ -254,7 +253,7 @@ groups:
labels:
severity: warning
annotations:
summary: Kubernetes CronJob too long (cronjob {{ $labels.cronjob }})
summary: Kubernetes CronJob too long (instance {{ $labels.instance }})
description: "CronJob {{ $labels.namespace }}/{{ $labels.cronjob }} is taking more than 1h to complete.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesJobSlowCompletion
Expand All @@ -263,7 +262,7 @@ groups:
labels:
severity: critical
annotations:
summary: Kubernetes Job slow completion (job_name {{ $labels.job_name }})
summary: Kubernetes Job slow completion (instance {{ $labels.instance }})
description: "Kubernetes Job {{ $labels.namespace }}/{{ $labels.job_name }} did not complete in time.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"

- alert: KubernetesApiServerErrors
Expand Down

0 comments on commit 4279ded

Please sign in to comment.