-
Notifications
You must be signed in to change notification settings - Fork 132
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
Insuffecient Slack Integration Docs #634
Comments
There is more documentation and an example here. Does that help you clarify how to integrate Slack? |
In addition, "context deadline exceeded" usually means a time-out of some sort. Which may be due to the controller being unable to reach out to Slack. |
This link is even more specific: https://fluxcd.io/flux/components/notification/providers/#slack-example We could put an earlier additional reference to this link up here: It might be too early to call out the reference to every |
Hi! I did not find any issues with Slack integration. The documentation is clear enough. The only culprit was how to prepare the proper slack token and how to put it into the secret. Then everything worked for me. BTW, I am using the full address of slack hook, not the token itself. Something like this: apiVersion: notification.toolkit.fluxcd.io/v1beta2
kind: Alert
metadata:
name: slack-p0
namespace: flux-system
spec:
eventSeverity: error
eventSources:
- kind: GitRepository
name: '*'
- kind: Kustomization
name: '*'
- kind: HelmRelease
name: '*'
providerRef:
name: slack-p0
summary: "UAT cluster" apiVersion: notification.toolkit.fluxcd.io/v1beta2
kind: Provider
metadata:
name: slack-p0
namespace: flux-system
spec:
channel: sys-fluxcd-errors
secretRef:
name: slack-url-p0-uat
type: slack kind: Secret
apiVersion: v1
metadata:
name: slack-url-p0-uat
namespace: flux-system
data:
address: >-
aHR......dndP
type: Opaque the address looked like So it is obvious that two or more options how to prepare the integration with Slack exists. |
I am using encrypted SOPS secret and defining the secret in this way giving me error "invalid URI for request". Here is my configuration apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
name: slack-bot-dev
namespace: flux-system
spec:
type: slack
secretRef:
name: webhook-url
---
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
name: slack-bot-dev
namespace: flux-system
spec:
summary: "flux notification"
eventMetadata:
env: "dev"
cluster: "aks-cluster"
region: "West Europe"
providerRef:
name: slack-bot-dev
eventSeverity: info
eventSources:
- kind: Kustomization
name: '*'
- kind: HelmRelease
name: '*' Sops encrypted secret
apiVersion: v1
kind: Secret
metadata:
name: webhook-url
namespace: flux-system
stringData:
address: ENC[AES256_GCM,data:VzeQbZEpTsB+ocrLE96tU+BtgtnkB894Qz5k79ffRewUYIFPgnz1c9APytr38AnO6y08qg1Gw6iZ23zwoX+eTejydvIEJRFfrlNY8LzAmd7WTysPR3kgk2qI=,tag:Q4k4q2kdORMoHqNJ4V7k8w==,type:str] sops original secret
apiVersion: v1
kind: Secret
metadata:
name: webhook-url
namespace: flux-system
stringData:
address: "https://hooks.slack.com/services/XXXXXX/XXXXXXX/XXXXXXXXXXXXX" |
@nishasati6oct Hi! Nice to meet you here. It is very pity to hear that you have the issue. Also could you please use markdown format, otherwise it is very difficult to read and understand your snippets. Thanks in advance. |
Updated my comment in markdown format :) apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
name: slack-bot-dev
namespace: flux-system
spec:
summary: "flux notification"
eventMetadata:
env: "dev"
cluster: "aks-cluster"
region: "West Europe"
providerRef:
name: slack-bot-dev
eventSeverity: info
eventSources:
- kind: HelmRelease
namespace: '*-dev'
name: '*' But in slack notification, I am not getting any HR notification. Please let me know if any changes needed here in alert configuration. Thanks for your help. :) |
@nishasati6oct Hi! It looks like that you need to put the |
This doesn't work |
There's no slack integration docs when configuring alerts so it's very hard to debug when configuring slack notifications.
By docs, I mean do we have to configure webhook, what permissions does the slack-bot require and how the secret should be configured. There's little to no information here: https://fluxcd.io/flux/monitoring/alerts/#define-a-provider
I am facing this error and I have no idea what's wrong with my slack configuration:
{"level":"error","ts":"xxx","logger":"event-server","msg":"failed to send notification","eventInvolvedObject":{"kind":"Kustomization","namespace":"flux-system"}, "alert":{"name":"slack-monitoring","namespace":"flux-system"},"error":"postMessage failed: failed to execute request: context deadline exceeded"}
Any leads would help!
The text was updated successfully, but these errors were encountered: