monitoring-alerting #30
@ -6,6 +6,27 @@ use crate::modules::helm::chart::HelmChartScore;
|
||||
|
||||
|
||||
pub fn kube_prometheus_score(ns: &str) -> HelmChartScore {
|
||||
//TODO this should be make into a rule with default formatting that can be easily passed as a vec
|
||||
//to the overrides or something leaving the user to deal with formatting here seems bad
|
||||
let values = r#"
|
||||
additionalPrometheusRules:
|
||||
- name: kubelet-alerts
|
||||
groups:
|
||||
- name: pvc-alerts
|
||||
rules:
|
||||
- alert: 'PVC Fill Over 95 Percent In 2 Days'
|
||||
annotations:
|
||||
description: The PVC {{ $labels.persistentvolumeclaim }} in namespace {{
|
||||
$labels.namespace }} is predicted to fill over 95% in less than 2 days.
|
||||
title: PVC {{ $labels.persistentvolumeclaim }} in namespace {{ $labels.namespace
|
||||
}} will fill over 95% in less than 2 days
|
||||
expr: "(\n kubelet_volume_stats_used_bytes \n / \n kubelet_volume_stats_capacity_bytes\n)
|
||||
> 0.95\nAND\npredict_linear(kubelet_volume_stats_used_bytes[2d], 2 * 24
|
||||
* 60 * 60)\n/\nkubelet_volume_stats_capacity_bytes\n> 0.95\n"
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
"#;
|
||||
HelmChartScore {
|
||||
namespace: Some(NonBlankString::from_str(ns).unwrap()),
|
||||
release_name: NonBlankString::from_str("kube-prometheus").unwrap(),
|
||||
|
Loading…
Reference in New Issue
Block a user