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

[Feature]: Slack output #133

Closed
2 tasks done
AlexsJones opened this issue May 30, 2023 · 5 comments
Closed
2 tasks done

[Feature]: Slack output #133

AlexsJones opened this issue May 30, 2023 · 5 comments

Comments

@AlexsJones
Copy link
Member

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've discussed this feature request in the K8sGPT Slack and got positive feedback

Is this feature request related to a problem?

No

Problem Description

No response

Solution Description

In order to provide even more value to users we should give them ability to alert slack

e.g.

apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
  name: k8sgpt-sample
  namespace: k8sgpt-operator-system
spec:
  model: gpt-3.5-turbo
  backend: openai
  noCache: false
  version: v0.3.0
  enableAI: true
  sinks:
   slack:
     webhook: <WEBHOOK>
  secret:
    name: k8sgpt-sample-secret
    key: openai-api-key

The idea is that this would let the user drop in a slack webhook to a pre-configured instance/channel

The main area for refactoring code would be here

I would suggest adding an additional sinks.Emit() style method and a new package pkg/sinks/slack where the sinks manager would have Slack as a registered sink type, we would also need a Configure method that is setup when the webhook is first detected on the CR

Benefits

Slack messages

Potential Drawbacks

No response

Additional Information

No response

@rakshitgondwal
Copy link
Member

Hi, @AlexsJones! This sounds interesting to me. Would like to pick it up.

@AlexsJones
Copy link
Member Author

Hi @rakshitgondwal, @arbreezy and I have discussed this and he will probably take on the initial implementation, but would you like to assist with that?

@rakshitgondwal
Copy link
Member

Hi @rakshitgondwal, @arbreezy and I have discussed this and he will probably take on the initial implementation, but would you like to assist with that?

Yes! I'd like to learn more about this.

@agardnerIT
Copy link

#377 is a bit wider than this discussion. This thread only takes Slack into account. I'm wondering if we can generalise this for any web hook endpoint.

Further thought: Can we make this work for OAuth2 enabled endpoints (where there's a 2 step process to first retrieve a token then send the actual request). Slack (AFAIK) works on the API token (fire and forget), which IMO is simpler and nicer - but it seems that lots of people love OAuth2.

@arbreezy
Copy link
Member

arbreezy commented Jun 7, 2023

I don't see how we can generalise the endpoint cause the accepted json message may be different in slack, discord, MS teams so on and so forth. We can make a generic implementation which will make it easy to construct different json payloads based on the reporting provider.
WDYT ?

@arbreezy arbreezy mentioned this issue Jun 8, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants