Monitor an application within a tenant #86
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/crd-alertmanager-configs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: added implementation to deploy crd-alertmanagerconfigs
wip: added an implementation of CRDalertmanagerconfigs that can be used to add a discord webhook receiver, currently the namespace is hard coded and there are a bunch of todos!() that need to be cleaned up, and flags need to be added so that alertmanag…to added an implementation of CRDalertmanagerconfigs that can be used to add a discord webhook receiver, currently the namespace is hard coded and there are a bunch of todos!() that need to be cleaned up, and flags need to be added so that alertmanag…@@ -34,2 +49,3 @@Box::new(Monitoring {Box::new(PrometheusApplicationMonitoring {application: application.clone(),alert_receiver: vec![Box::new(discord_receiver), Box::new(webhook_receiver)],As JG mentioned, we want to keep this as simple as possible, as opinionated as possible.
If we keep it named
Monitoringwe can just replace the inner implementation later.@@ -0,0 +42,4 @@use super::prometheus::PrometheusMonitoring;#[derive(Clone, Debug, Serialize)]pub struct K3dPrometheusCRDAlertingScore {This file is almost identical to
k8s_prometheus_alerting_score, the only difference being that this one has anamespaceattribute whereas thek8sone has asenderthat is used to retrieve the namespace.Is there a reason for these 2 almost identical files?
Also, this file is actually unused.
@@ -0,0 +13,4 @@}#[async_trait]pub trait PrometheusApplicationMonitoring<S: AlertSender>: PrometheusMonitoring<S> {This trait shouldn't be extending
PrometheusMonitoringas they're not really related to each other. It's 2 different capabilities.And actually if you dig a bit more, you see that
ensure_prometheus_operatoris used only internally byK8sAnywhereitself. So it should be a private method there instead of a separate capability.8d4e06ced1to056152a1e5@@ -25,6 +25,15 @@ pub struct K8sClient {client: Client,}impl Serialize for K8sClient {I'm not sure it's really a good thing that we try to
SerializetheK8sClient🤔 maybe we should find a way to avoid needing to store theclientinto theCrdPrometheussender@@ -0,0 +8,4 @@#[async_trait]pub trait PrometheusApplicationMonitoring<S: AlertSender> {async fn install_prometheus(install_prometheusseems a bit inaccurate: we're not installing prometheus here, we're installing the receivers to run on prometheusmaybe should be renamed to
install_receiversorinstall_monitoringor something similar@@ -23,2 +108,4 @@}#[async_trait]impl AlertReceiver<Prometheus> for DiscordWebhook {this
Prometheussender doesn't seem to be used, meaning theAlertReceiver<Prometheus>implementation doesn't seem to be used either (and same goes for the webhook alert channel)@@ -0,0 +243,4 @@Ok(Outcome::success(format!("installed grafana operator in ns {}",self.sender.namespace.clone().clone()is there a reason why these double
clone().clone()? there's a lot of them in this file@@ -234,2 +238,3 @@//network"ipBlock": {"cidr": "172.23.0.0/16","cidr": "172.24.0.0/16",Selon le contexte (e.g. K3dLocal), introduire une nouvelle implementation
K3d/sTenantManagerqui permet d'aller chercher dans docker l'adresse ip a definir ici.@@ -0,0 +28,4 @@//TODO there is a bug where the application is deployed into the namespace matching the//application name and the tenant is created in the namesapce matching the tenant name//in order for the application to be deployed in the tenant namespace the application.name and//the TenantConfig.name must matchPersonal opinion, but I'm not even sure the end user should have to worry about providing names for the tenant, the application, or any other scores. It would be simpler if there is one "global" name for the whole configuration.
Something like this:
That would simplify the setup and we would be able to enforce that the tenant name is the same as the application name behind the scene.
added an implementation of CRDalertmanagerconfigs that can be used to add a discord webhook receiver, currently the namespace is hard coded and there are a bunch of todos!() that need to be cleaned up, and flags need to be added so that alertmanag…to Monitor an application within a tenant