WIP: initial layout for MonitoringStackScore
This commit is contained in:
		
							parent
							
								
									db9c8d83e6
								
							
						
					
					
						commit
						40cd765019
					
				| @ -10,3 +10,4 @@ pub mod load_balancer; | |||||||
| pub mod okd; | pub mod okd; | ||||||
| pub mod opnsense; | pub mod opnsense; | ||||||
| pub mod tftp; | pub mod tftp; | ||||||
|  | pub mod monitoring; | ||||||
|  | |||||||
							
								
								
									
										3
									
								
								harmony/src/modules/monitoring/mod.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								harmony/src/modules/monitoring/mod.rs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | mod monitoring_alerting; | ||||||
|  | mod resources; | ||||||
|  | pub use monitoring_alerting::*; | ||||||
							
								
								
									
										23
									
								
								harmony/src/modules/monitoring/monitoring_alerting.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								harmony/src/modules/monitoring/monitoring_alerting.rs
									
									
									
									
									
										Normal 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) | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										19
									
								
								harmony/src/modules/monitoring/resources/grafana.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								harmony/src/modules/monitoring/resources/grafana.rs
									
									
									
									
									
										Normal 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, | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								harmony/src/modules/monitoring/resources/mod.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								harmony/src/modules/monitoring/resources/mod.rs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | mod grafana; | ||||||
|  | mod prometheus; | ||||||
|  | mod prometheus_alert_manager; | ||||||
							
								
								
									
										19
									
								
								harmony/src/modules/monitoring/resources/prometheus.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								harmony/src/modules/monitoring/resources/prometheus.rs
									
									
									
									
									
										Normal 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, | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -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, | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user