Compare commits
No commits in common. "861f266c4ec9733570e8201eab65cd9613dd16cc" and "c2d1cb9b762a1efc7f74d4a862723501084cfe03" have entirely different histories.
861f266c4e
...
c2d1cb9b76
@ -2,10 +2,7 @@ use harmony::{
|
|||||||
data::Version,
|
data::Version,
|
||||||
inventory::Inventory,
|
inventory::Inventory,
|
||||||
maestro::Maestro,
|
maestro::Maestro,
|
||||||
modules::{
|
modules::lamp::{LAMPConfig, LAMPScore},
|
||||||
lamp::{LAMPConfig, LAMPScore},
|
|
||||||
monitoring::monitoring_alerting::MonitoringAlertingStackScore,
|
|
||||||
},
|
|
||||||
topology::{K8sAnywhereTopology, Url},
|
topology::{K8sAnywhereTopology, Url},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -27,7 +24,7 @@ async fn main() {
|
|||||||
// This config can be extended as needed for more complicated configurations
|
// This config can be extended as needed for more complicated configurations
|
||||||
config: LAMPConfig {
|
config: LAMPConfig {
|
||||||
project_root: "./php".into(),
|
project_root: "./php".into(),
|
||||||
database_size: format!("4Gi").into(),
|
database_size: format!("2Gi").into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -42,11 +39,7 @@ async fn main() {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
maestro.register_all(vec![Box::new(lamp_stack)]);
|
||||||
let monitoring_stack_score =
|
|
||||||
MonitoringAlertingStackScore::new_with_ns(&lamp_stack.config.namespace);
|
|
||||||
|
|
||||||
maestro.register_all(vec![Box::new(lamp_stack), Box::new(monitoring_stack_score)]);
|
|
||||||
// Here we bootstrap the CLI, this gives some nice features if you need them
|
// Here we bootstrap the CLI, this gives some nice features if you need them
|
||||||
harmony_cli::init(maestro, None).await.unwrap();
|
harmony_cli::init(maestro, None).await.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,9 @@ impl K8sAnywhereTopology {
|
|||||||
|
|
||||||
async fn try_get_or_install_k8s_client(&self) -> Result<Option<K8sState>, InterpretError> {
|
async fn try_get_or_install_k8s_client(&self) -> Result<Option<K8sState>, InterpretError> {
|
||||||
let k8s_anywhere_config = K8sAnywhereConfig {
|
let k8s_anywhere_config = K8sAnywhereConfig {
|
||||||
kubeconfig: std::env::var("KUBECONFIG").ok().map(|v| v.to_string()),
|
kubeconfig: std::env::var("HARMONY_KUBECONFIG")
|
||||||
|
.ok()
|
||||||
|
.map(|v| v.to_string()),
|
||||||
use_system_kubeconfig: std::env::var("HARMONY_USE_SYSTEM_KUBECONFIG")
|
use_system_kubeconfig: std::env::var("HARMONY_USE_SYSTEM_KUBECONFIG")
|
||||||
.map_or_else(|_| false, |v| v.parse().ok().unwrap_or(false)),
|
.map_or_else(|_| false, |v| v.parse().ok().unwrap_or(false)),
|
||||||
autoinstall: std::env::var("HARMONY_AUTOINSTALL")
|
autoinstall: std::env::var("HARMONY_AUTOINSTALL")
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
pub mod monitoring_alerting;
|
||||||
mod ha_cluster;
|
mod ha_cluster;
|
||||||
mod host_binding;
|
mod host_binding;
|
||||||
mod http;
|
mod http;
|
||||||
|
|||||||
108
harmony/src/domain/topology/monitoring_alerting.rs
Normal file
108
harmony/src/domain/topology/monitoring_alerting.rs
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use log::warn;
|
||||||
|
use tokio::sync::OnceCell;
|
||||||
|
|
||||||
|
use k8s_openapi::api::core::v1::Pod;
|
||||||
|
use kube::{
|
||||||
|
Client,
|
||||||
|
api::{Api, ListParams},
|
||||||
|
};
|
||||||
|
|
||||||
|
use async_trait::async_trait;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
interpret::{InterpretError, Outcome},
|
||||||
|
inventory::Inventory,
|
||||||
|
maestro::Maestro,
|
||||||
|
modules::monitoring::monitoring_alerting::MonitoringAlertingStackScore,
|
||||||
|
score::Score,
|
||||||
|
};
|
||||||
|
|
||||||
|
use super::{HelmCommand, K8sAnywhereTopology, Topology, k8s::K8sClient};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
struct MonitoringState {
|
||||||
|
message: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct MonitoringAlertingTopology {
|
||||||
|
monitoring_state: OnceCell<Option<MonitoringState>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MonitoringAlertingTopology {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self {
|
||||||
|
monitoring_state: OnceCell::new(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_monitoring_state(&self) -> Result<Option<MonitoringState>, InterpretError> {
|
||||||
|
let client = Client::try_default()
|
||||||
|
.await
|
||||||
|
.map_err(|e| InterpretError::new(format!("Kubernetes client error: {}", e)))?;
|
||||||
|
|
||||||
|
for ns in &["monitoring", "openshift-monitoring"] {
|
||||||
|
let pods: Api<Pod> = Api::namespaced(client.clone(), ns);
|
||||||
|
//TODO hardcoding the label is a problem
|
||||||
|
//check all pods are ready
|
||||||
|
let lp = ListParams::default().labels("app.kubernetes.io/name=prometheus");
|
||||||
|
|
||||||
|
match pods.list(&lp).await {
|
||||||
|
Ok(pod_list) => {
|
||||||
|
for p in pod_list.items {
|
||||||
|
if let Some(status) = p.status {
|
||||||
|
if let Some(conditions) = status.conditions {
|
||||||
|
if conditions
|
||||||
|
.iter()
|
||||||
|
.any(|c| c.type_ == "Ready" && c.status == "True")
|
||||||
|
{
|
||||||
|
return Ok(Some(MonitoringState {
|
||||||
|
message: format!(
|
||||||
|
"Prometheus is ready in namespace: {}",
|
||||||
|
ns
|
||||||
|
),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
warn!("Failed to query pods in ns {}: {}", ns, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T: Topology> Clone for Box<dyn Score<T>> {
|
||||||
|
fn clone(&self) -> Box<dyn Score<T>> {
|
||||||
|
self.clone_box()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl Topology for MonitoringAlertingTopology {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
"MonitoringAlertingTopology"
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn ensure_ready(&self) -> Result<Outcome, InterpretError> {
|
||||||
|
if let Some(state) = self.get_monitoring_state().await? {
|
||||||
|
// Monitoring stack is already ready — stop app.
|
||||||
|
println!("{}", state.message);
|
||||||
|
std::process::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Monitoring not found — proceed with installation.
|
||||||
|
Ok(Outcome::success(
|
||||||
|
"Monitoring stack installation started.".to_string(),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl HelmCommand for MonitoringAlertingTopology {}
|
||||||
@ -6,7 +6,7 @@ use crate::topology::{HelmCommand, Topology};
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use helm_wrapper_rs;
|
use helm_wrapper_rs;
|
||||||
use helm_wrapper_rs::blocking::{DefaultHelmExecutor, HelmExecutor};
|
use helm_wrapper_rs::blocking::{DefaultHelmExecutor, HelmExecutor};
|
||||||
use log::{debug, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
pub use non_blank_string_rs::NonBlankString;
|
pub use non_blank_string_rs::NonBlankString;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@ -104,7 +104,6 @@ impl HelmChartInterpret {
|
|||||||
|
|
||||||
fn run_helm_command(args: &[&str]) -> Result<Output, InterpretError> {
|
fn run_helm_command(args: &[&str]) -> Result<Output, InterpretError> {
|
||||||
let command_str = format!("helm {}", args.join(" "));
|
let command_str = format!("helm {}", args.join(" "));
|
||||||
debug!("Got KUBECONFIG: `{}`", std::env::var("KUBECONFIG").unwrap());
|
|
||||||
debug!("Running Helm command: `{}`", command_str);
|
debug!("Running Helm command: `{}`", command_str);
|
||||||
|
|
||||||
let output = Command::new("helm")
|
let output = Command::new("helm")
|
||||||
@ -160,13 +159,7 @@ impl<T: Topology + HelmCommand> Interpret<T> for HelmChartInterpret {
|
|||||||
|
|
||||||
self.add_repo()?;
|
self.add_repo()?;
|
||||||
|
|
||||||
let helm_executor = DefaultHelmExecutor::new_with_opts(
|
let helm_executor = DefaultHelmExecutor::new();
|
||||||
&NonBlankString::from_str("helm").unwrap(),
|
|
||||||
None,
|
|
||||||
900,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut helm_options = Vec::new();
|
let mut helm_options = Vec::new();
|
||||||
if self.score.create_namespace {
|
if self.score.create_namespace {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ impl<T: Topology + K8sclient> Score<T> for K8sDeploymentScore {
|
|||||||
{
|
{
|
||||||
"image": self.image,
|
"image": self.image,
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"imagePullPolicy": "Always",
|
"imagePullPolicy": "IfNotPresent",
|
||||||
"env": self.env_vars,
|
"env": self.env_vars,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -38,7 +38,6 @@ pub struct LAMPConfig {
|
|||||||
pub project_root: PathBuf,
|
pub project_root: PathBuf,
|
||||||
pub ssl_enabled: bool,
|
pub ssl_enabled: bool,
|
||||||
pub database_size: Option<String>,
|
pub database_size: Option<String>,
|
||||||
pub namespace: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for LAMPConfig {
|
impl Default for LAMPConfig {
|
||||||
@ -47,7 +46,6 @@ impl Default for LAMPConfig {
|
|||||||
project_root: Path::new("./src").to_path_buf(),
|
project_root: Path::new("./src").to_path_buf(),
|
||||||
ssl_enabled: true,
|
ssl_enabled: true,
|
||||||
database_size: None,
|
database_size: None,
|
||||||
namespace: "harmony-lamp".to_string(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,6 +54,7 @@ impl<T: Topology + K8sclient + HelmCommand> Score<T> for LAMPScore {
|
|||||||
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
||||||
Box::new(LAMPInterpret {
|
Box::new(LAMPInterpret {
|
||||||
score: self.clone(),
|
score: self.clone(),
|
||||||
|
namespace: "harmony-lamp".to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +66,7 @@ impl<T: Topology + K8sclient + HelmCommand> Score<T> for LAMPScore {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LAMPInterpret {
|
pub struct LAMPInterpret {
|
||||||
score: LAMPScore,
|
score: LAMPScore,
|
||||||
|
namespace: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
@ -132,9 +132,7 @@ impl<T: Topology + K8sclient + HelmCommand> Interpret<T> for LAMPInterpret {
|
|||||||
|
|
||||||
info!("LAMP deployment_score {deployment_score:?}");
|
info!("LAMP deployment_score {deployment_score:?}");
|
||||||
|
|
||||||
Ok(Outcome::success(
|
Ok(Outcome::success("Successfully deployed LAMP Stack!".to_string()))
|
||||||
"Successfully deployed LAMP Stack!".to_string(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_name(&self) -> InterpretName {
|
fn get_name(&self) -> InterpretName {
|
||||||
@ -166,10 +164,6 @@ impl LAMPInterpret {
|
|||||||
NonBlankString::from_str("primary.persistence.size").unwrap(),
|
NonBlankString::from_str("primary.persistence.size").unwrap(),
|
||||||
database_size,
|
database_size,
|
||||||
);
|
);
|
||||||
values_overrides.insert(
|
|
||||||
NonBlankString::from_str("auth.rootPassword").unwrap(),
|
|
||||||
"mariadb-changethis".to_string(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
let score = HelmChartScore {
|
let score = HelmChartScore {
|
||||||
namespace: self.get_namespace(),
|
namespace: self.get_namespace(),
|
||||||
@ -182,7 +176,7 @@ impl LAMPInterpret {
|
|||||||
chart_version: None,
|
chart_version: None,
|
||||||
values_overrides: Some(values_overrides),
|
values_overrides: Some(values_overrides),
|
||||||
create_namespace: true,
|
create_namespace: true,
|
||||||
install_only: false,
|
install_only: true,
|
||||||
values_yaml: None,
|
values_yaml: None,
|
||||||
repository: None,
|
repository: None,
|
||||||
};
|
};
|
||||||
@ -237,9 +231,6 @@ impl LAMPInterpret {
|
|||||||
opcache",
|
opcache",
|
||||||
));
|
));
|
||||||
|
|
||||||
dockerfile.push(RUN::from(r#"sed -i 's/VirtualHost \*:80/VirtualHost *:8080/' /etc/apache2/sites-available/000-default.conf && \
|
|
||||||
sed -i 's/^Listen 80$/Listen 8080/' /etc/apache2/ports.conf"#));
|
|
||||||
|
|
||||||
// Copy PHP configuration
|
// Copy PHP configuration
|
||||||
dockerfile.push(RUN::from("mkdir -p /usr/local/etc/php/conf.d/"));
|
dockerfile.push(RUN::from("mkdir -p /usr/local/etc/php/conf.d/"));
|
||||||
|
|
||||||
@ -305,7 +296,7 @@ opcache.fast_shutdown=1
|
|||||||
dockerfile.push(RUN::from("chown -R appuser:appuser /var/www/html"));
|
dockerfile.push(RUN::from("chown -R appuser:appuser /var/www/html"));
|
||||||
|
|
||||||
// Expose Apache port
|
// Expose Apache port
|
||||||
dockerfile.push(EXPOSE::from("8080/tcp"));
|
dockerfile.push(EXPOSE::from("80/tcp"));
|
||||||
|
|
||||||
// Set the default command
|
// Set the default command
|
||||||
dockerfile.push(CMD::from("apache2-foreground"));
|
dockerfile.push(CMD::from("apache2-foreground"));
|
||||||
@ -389,6 +380,6 @@ opcache.fast_shutdown=1
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_namespace(&self) -> Option<NonBlankString> {
|
fn get_namespace(&self) -> Option<NonBlankString> {
|
||||||
Some(NonBlankString::from_str(&self.score.config.namespace).unwrap())
|
Some(NonBlankString::from_str(&self.namespace).unwrap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ pub mod k3d;
|
|||||||
pub mod k8s;
|
pub mod k8s;
|
||||||
pub mod lamp;
|
pub mod lamp;
|
||||||
pub mod load_balancer;
|
pub mod load_balancer;
|
||||||
pub mod monitoring;
|
|
||||||
pub mod okd;
|
pub mod okd;
|
||||||
pub mod opnsense;
|
pub mod opnsense;
|
||||||
pub mod tftp;
|
pub mod tftp;
|
||||||
|
pub mod monitoring;
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
mod kube_prometheus;
|
|
||||||
pub mod monitoring_alerting;
|
pub mod monitoring_alerting;
|
||||||
|
mod kube_prometheus;
|
||||||
|
|
||||||
|
|||||||
@ -1,27 +1,35 @@
|
|||||||
|
use async_trait::async_trait;
|
||||||
|
use log::info;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
interpret::Interpret,
|
data::{Id, Version},
|
||||||
modules::helm::chart::HelmChartScore,
|
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
|
||||||
score::Score,
|
inventory::Inventory,
|
||||||
topology::{HelmCommand, Topology},
|
maestro::Maestro,
|
||||||
|
score::{CloneBoxScore, Score},
|
||||||
|
topology::{HelmCommand, Topology, monitoring_alerting::MonitoringAlertingTopology},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::kube_prometheus::kube_prometheus_score;
|
use super::kube_prometheus::kube_prometheus_score;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug)]
|
||||||
pub struct MonitoringAlertingStackScore {
|
pub struct MonitoringAlertingStackScore {
|
||||||
// TODO Support other components in our monitoring/alerting stack instead of a single helm
|
//TODO add documenation to explain why its here
|
||||||
// chart
|
//keeps it open for the end user to specify which stack they want
|
||||||
pub monitoring_stack: HelmChartScore,
|
//if it isnt default kube-prometheus
|
||||||
|
pub monitoring_stack: Vec<Box<dyn Score<MonitoringAlertingTopology>>>,
|
||||||
pub namespace: String,
|
pub namespace: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MonitoringAlertingStackScore {
|
impl MonitoringAlertingStackScore {
|
||||||
pub fn new_with_ns(ns: &str) -> Self {
|
pub fn new(
|
||||||
|
monitoring_stack: Vec<Box<dyn Score<MonitoringAlertingTopology>>>,
|
||||||
|
namespace: String,
|
||||||
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
monitoring_stack: kube_prometheus_score(ns),
|
monitoring_stack,
|
||||||
namespace: ns.to_string(),
|
namespace,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -30,18 +38,107 @@ impl Default for MonitoringAlertingStackScore {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let ns = "monitoring";
|
let ns = "monitoring";
|
||||||
Self {
|
Self {
|
||||||
monitoring_stack: kube_prometheus_score(ns),
|
monitoring_stack: vec![Box::new(kube_prometheus_score(ns))],
|
||||||
namespace: ns.to_string(),
|
namespace: ns.to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl Clone for MonitoringAlertingStackScore {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
Self {
|
||||||
|
monitoring_stack: self
|
||||||
|
.monitoring_stack
|
||||||
|
.iter()
|
||||||
|
.map(|s| s.clone_box())
|
||||||
|
.collect(),
|
||||||
|
namespace: self.namespace.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: Topology + HelmCommand> Score<T> for MonitoringAlertingStackScore {
|
impl Serialize for MonitoringAlertingStackScore {
|
||||||
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
|
where
|
||||||
|
S: serde::Serializer,
|
||||||
|
{
|
||||||
|
use serde::ser::SerializeStruct;
|
||||||
|
let mut s = serializer.serialize_struct("MonitoringAlertingStackScore", 1)?;
|
||||||
|
let monitoring_values: Vec<_> = self
|
||||||
|
.monitoring_stack
|
||||||
|
.iter()
|
||||||
|
.map(|m| m.serialize())
|
||||||
|
.collect();
|
||||||
|
s.serialize_field("monitoring", &monitoring_values)?;
|
||||||
|
s.end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T:Topology> Score<T> for MonitoringAlertingStackScore {
|
||||||
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
||||||
self.monitoring_stack.create_interpret()
|
Box::new(MonitoringAlertingStackInterpret {
|
||||||
|
score: MonitoringAlertingStackScore {
|
||||||
|
monitoring_stack: self
|
||||||
|
.monitoring_stack
|
||||||
|
.iter()
|
||||||
|
.map(|s| s.clone_box())
|
||||||
|
.collect(),
|
||||||
|
namespace: self.namespace.clone(),
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name(&self) -> String {
|
fn name(&self) -> String {
|
||||||
format!("MonitoringAlertingStackScore")
|
format!("MonitoringAlertingStackScore")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct MonitoringAlertingStackInterpret {
|
||||||
|
pub score: MonitoringAlertingStackScore,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl <T: Topology> Interpret<T> for MonitoringAlertingStackInterpret {
|
||||||
|
async fn execute(
|
||||||
|
&self,
|
||||||
|
_inventory: &Inventory,
|
||||||
|
_topology: &T,
|
||||||
|
) -> Result<Outcome, InterpretError> {
|
||||||
|
let inventory = Inventory::autoload();
|
||||||
|
let topology = MonitoringAlertingTopology::new();
|
||||||
|
let maestro = match Maestro::initialize(inventory, topology).await {
|
||||||
|
Ok(m) => m,
|
||||||
|
Err(e) => {
|
||||||
|
println!("failed to initialize Maestro: {}", e);
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let scores_vec = self.score.monitoring_stack.clone();
|
||||||
|
for s in scores_vec{
|
||||||
|
info!("Running: {}", s.name());
|
||||||
|
maestro.interpret(s).await?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(Outcome::success(format!(
|
||||||
|
"monitoring stack installed in {} namespace",
|
||||||
|
self.score.namespace
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_name(&self) -> InterpretName {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_version(&self) -> Version {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_status(&self) -> InterpretStatus {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_children(&self) -> Vec<Id> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user