Granular control of slack notifications #5527
-
|
I am in the process of transitioning 13 clusters managed by flux from a cluster-per-branch setup to a cluster directories in a main branch setup as advised. From before we have separate slack channels with notifications from flux from each cluster and repo. However, when moving the setup into a monobranch setup the messages from one cluster is sent to all channels on Slack. Our manifests looks like this in each respective cluster: apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
name: slack-alerts
namespace: flux-system
spec:
providerRef:
name: slack
eventSeverity: info
eventSources:
- kind: GitRepository
name: "*"
- kind: Kustomization
name: "*"
- kind: HelmRelease
name: "*"apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
name: slack
namespace: flux-system
spec:
type: slack
channel: <slack channel name, cluster-based>
proxy: <proxy server>
secretRef:
name: slack-urlapiVersion: v1
stringData:
address: <slack hook address>
kind: Secret
metadata:
name: slack-url
namespace: flux-systemI couldn't find anything in the official docs about this, but how can I keep our existing slack channels having each cluster send notifications to each respective channel? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Having a single source for all your clusters is still a problem even if you move away from the bad multi-branch pattern. Events about reconciliations unrelated to the cluster landing in the cluster Slack channel is the smallest of your problems. The bigger problem is causing the reconciliations in the first place. To fix this our recommendation is to move from https://fluxcd.control-plane.io/guides/d2-architecture-reference/ |
Beta Was this translation helpful? Give feedback.
Having a single source for all your clusters is still a problem even if you move away from the bad multi-branch pattern. Events about reconciliations unrelated to the cluster landing in the cluster Slack channel is the smallest of your problems. The bigger problem is causing the reconciliations in the first place. To fix this our recommendation is to move from
GitRepositorytoOCIRepository. This way you can manage all your clusters in a single Git branch but still break the repo down in small per-cluster artifacts, this is the key design change in ControlPlane's D2 Reference Architecture:https://fluxcd.control-plane.io/guides/d2-architecture-reference/