WIP: initial layout for MonitoringStackScore

This commit is contained in:
Willem 2025-04-28 16:18:44 -04:00
parent db9c8d83e6
commit 40cd765019
7 changed files with 88 additions and 0 deletions

View File

@ -10,3 +10,4 @@ pub mod load_balancer;
pub mod okd;
pub mod opnsense;
pub mod tftp;
pub mod monitoring;

View File

@ -0,0 +1,3 @@
mod monitoring_alerting;
mod resources;
pub use monitoring_alerting::*;

View File

@ -0,0 +1,23 @@
use serde::Serialize;
use crate::{
interpret::Interpret, maestro::Maestro, modules::helm::chart::HelmChartScore, score::Score, topology::{K8sclient, Topology}
};
#[derive(Debug, Clone, Serialize)]
pub struct MonitoringAlertingStackScore {
monitoring: HelmChartScore,
alerting: HelmChartScore,
alert_manager: HelmChartScore,
}
impl<T: Topology> Score<T> for MonitoringAlertingStackScore {
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
todo!()
}
fn name(&self) -> String {
format!("Monitoring: {}\n, Alerting: {}\n, Alert Manager: {}\n", self.monitoring, self.alerting, self.alert_manager)
}
}

View File

@ -0,0 +1,19 @@
use std::str::FromStr;
use non_blank_string_rs::NonBlankString;
use crate::modules::helm::chart::HelmChartScore;
pub fn grafana_score(ns: &str) -> HelmChartScore {
HelmChartScore {
namespace: Some(NonBlankString::from_str(ns).unwrap()),
release_name: NonBlankString::from_str("es").unwrap(),
chart_name: NonBlankString::from_str(
"oci://registry-1.docker.io/bitnamicharts/grafana",
)
.unwrap(),
chart_version: None,
values_overrides: None,
}
}

View File

@ -0,0 +1,3 @@
mod grafana;
mod prometheus;
mod prometheus_alert_manager;

View File

@ -0,0 +1,19 @@
use std::str::FromStr;
use non_blank_string_rs::NonBlankString;
use crate::modules::helm::chart::HelmChartScore;
pub fn elasticsearch_score(ns: &str) -> HelmChartScore {
HelmChartScore {
namespace: Some(NonBlankString::from_str(ns).unwrap()),
release_name: NonBlankString::from_str("es").unwrap(),
chart_name: NonBlankString::from_str(
todo()!
)
.unwrap(),
chart_version: None,
values_overrides: None,
}
}

View File

@ -0,0 +1,20 @@
use std::str::FromStr;
use non_blank_string_rs::NonBlankString;
use crate::modules::helm::chart::HelmChartScore;
pub fn elasticsearch_score(ns: &str) -> HelmChartScore {
HelmChartScore {
namespace: Some(NonBlankString::from_str(ns).unwrap()),
release_name: NonBlankString::from_str("es").unwrap(),
chart_name: NonBlankString::from_str(
todo()!
)
.unwrap(),
chart_version: None,
values_overrides: None,
}
}