Monitor an application within a tenant #86
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: NationTech/harmony#86
Loading…
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
Monitoring
we 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 anamespace
attribute whereas thek8s
one has asender
that 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
PrometheusMonitoring
as 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_operator
is used only internally byK8sAnywhere
itself. So it should be a private method there instead of a separate capability.8d4e06ced1
to056152a1e5
@ -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
Serialize
theK8sClient
🤔 maybe we should find a way to avoid needing to store theclient
into theCrdPrometheus
sender@ -0,0 +8,4 @@
#[async_trait]
pub trait PrometheusApplicationMonitoring<S: AlertSender> {
async fn install_prometheus(
install_prometheus
seems a bit inaccurate: we're not installing prometheus here, we're installing the receivers to run on prometheusmaybe should be renamed to
install_receivers
orinstall_monitoring
or something similar@ -23,2 +108,4 @@
}
#[async_trait]
impl AlertReceiver<Prometheus> for DiscordWebhook {
this
Prometheus
sender 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/sTenantManager
qui 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 match
Personal 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