Skip to content
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

notifyURL not functional #84

Closed
fmunteanu opened this issue May 13, 2024 · 3 comments
Closed

notifyURL not functional #84

fmunteanu opened this issue May 13, 2024 · 3 comments
Labels
question Further information is requested

Comments

@fmunteanu
Copy link

fmunteanu commented May 13, 2024

Update: See the working implementation, which does not require mentioning the username or channel.

I created a Kured app in Slack and tested the functionality with the provided Webhook URL:

curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/<redacted>/<redacted>/<redacted>

image

Chart settings:

USER-SUPPLIED VALUES:
configuration:
  concurrency: 1
  endTime: "07:59"
  notifyUrl: https://hooks.slack.com/services/<redacted>/<redacted>/<redacted>
  period: 15m
  rebootDelay: 60s
  startTime: "04:00"
  timeZone: UTC
metrics:
  create: true
  labels:
    release: kube-prometheus-stack
  namespace: kube-system
resources:
  limits:
    cpu: 400m
    memory: 256Mi
  requests:
    cpu: 100m
    memory: 64Mi
service:
  annotations:
    prometheus.io/path: /metrics
    prometheus.io/port: 8080
    prometheus.io/scrape: true
  create: true
  name: kured
tolerations:
- effect: NoSchedule
  key: node-role.kubernetes.io/control-plane
  operator: Exists

I also need some clarifications if the messageTemplate chart settings are related to Slack only.

I was wondering if anyone can shed some light where the issue resides. cc @dholbach @jackfrancis.

@ckotzbauer
Copy link
Member

Hey @fmunteanu,
please have a look at our docs: https://kured.dev/docs/configuration/#notifications
We use "shoutrrr" for notifications, you can use any notification-service shoutrrr supports. Nothing is specific to slack here. There's no logic in kured which does a special notification handling, we just submit one of the three message-templates to the given URL via shoutrrr.
There are three different notifications (with three configurable message-templates):

  • Draining
  • Rebooting
  • Uncordoning

Does this answer your question? Any errors on notifying would be printed as warn-log into kured's pod-logs.

@ckotzbauer ckotzbauer added the question Further information is requested label May 13, 2024
@fmunteanu
Copy link
Author

fmunteanu commented May 15, 2024

Using the documented format fixed the issue:

image

I noticed there is a mention about the username and channel in kubereboot/kured#482. I created a Slack app assigned to alerts channel and used the generated credentials, there are no issues posting into correct private channel, with correct user. I don't have to mention the username or channel into notifyUrl string:

notifyUrl: slack://<redacted>/<redacted>/<redacted>

@ckotzbauer
Copy link
Member

I don't have to mention the username or channel into notifyUrl string

Yes, the separate username argument is deprecated in kured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants