-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to get cluster-name, while we are sending notifications to ms teams #382
Comments
You can mention it in the |
In |
@Naresh240 if what you mean is the cluster name being automatically added to the alert, that is currently not supported. |
I think it would generally make sense to have a means of exposing a cluster name through the Events API. However, the question is, how? One could use the |
The cluster name is unknown to Kubernetes itself, so there is no way to get this info automatically. You can use a kustomize patch that targets all Alerts objects and sets the cluster name in |
How about adding a dedicated |
Why add a 2nd field that does the same thing as summary? I would consider adding a cmd flag to notification-controller e.g. |
@stefanprodan How could an implementation of this look like when using Grafana Annotations? Would be nice to show somehow from which cluster the annotations comes from. |
This feels like a big deal. We want to use Flux to orchestrate deployments to a fleet of Kube Clusters. If we don't know where the events are coming back from, then its value gets a little muddy. |
What we (Weaveworks) did in Weave GitOps Enterprise is to instantiate an endpoint on the management cluster for each managed cluster so that each managed cluster hits a unique endpoint. |
@makkes is there a solution that didn't involve a management cluster? The current state makes alerts very difficult to use. |
This can be achieved with Flux variable substitutions. At cluster creation you would generate a ConfigMap (from Terraform or another IaC tool) with the cluster name, region, env, etc like so: apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-info
namespace: flux-system
data:
cluster_name: my-cluster
cluster_region: my-region In the Flux Kustomization that applies the Alerts you would enable variable substitution like so: apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: alerts
namespace: flux-system
spec:
postBuild:
substituteFrom:
- kind: ConfigMap
name: cluster-info Finally, in the Alert manifests you would set the variables: apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
name: msteams
namespace: flux-system
spec:
eventMetadata:
app.kubernetes.io/cluster: "${cluster_name}"
app.kubernetes.io/region: "${cluster_region}"
providerRef:
name: msteams
eventSources:
- kind: HelmRelease
name: '*'
namespace: apps
- kind: HelmRelease
name: '*'
namespace: addons The |
We are trying to send notifications from different cluster, nearly we are creating 10 clusters at a time, need to get notifications to same channel with cluster name. so that we can easily identify from which cluster we are getting notification.
Please help where I need to mention about cluster name?
The text was updated successfully, but these errors were encountered: