Giter VIP home page Giter VIP logo

Comments (5)

whs avatar whs commented on July 26, 2024 1

I just added SLACK_CHANNEL option in master. Could you please try the image with latest tag?

from kube-slack.

whs avatar whs commented on July 26, 2024

I'm not sure I understand this request.

If you want to change Slack channel, then you can do so by configuring your incoming webhooks channel.

The kube-slack/slack-channel annotation is for overriding the above configuration for specific pods and is not required.

from kube-slack.

omerozery avatar omerozery commented on July 26, 2024

OK, i will try to explain, maybe i'm mistaken due to my lack of knowledge in slack.

  1. i have 9 namespaces across 4 clusters, with 22 deployments each, to taint every pod with kube-slack/slack-channel is out of the question, because i need it globally configured per cluster, so it seems a misuse of the specific-pods-annotations feature. (from what i understand it is impossible to configure multiple channels per incoming webhook, and even if it is possible there is no environment variable in kube-slack deployment for changing the channel)

  2. Although i can create 4 Incoming WebHooks (1 for each cluster) and place their URL in each of the kube-slack deployments, i will have to maintain some kind of map (SLACK_URL vs CLUSER_NAME), which turns to be very clumsy, and i want to keep my cluster's deployment and management logic to a minimum, like i did so far with any organization-wide tool that has to be per cluster configured.

  • the only thing that changes between clusters is the CLUSTER_NAME which can also be used as SLACK_CHANNEL (or some kind of string manipulation of it). if i cloud change only the SLACK_CHANNEL when i deploy kube-slack as part of single k8s cluster deployment process while the SLACK_URL or the SLACK_TOKEN remains the same.

hope that it explains the reason. @mdemri

from kube-slack.

omerozery avatar omerozery commented on July 26, 2024

thanks! i will check it today and let you know

from kube-slack.

omerozery avatar omerozery commented on July 26, 2024

Thanks @whs it works great, and it is really helpful :)
now my kube-slack deployment, serviceaccount, clusterrole, clusterrolebinding are identical to all clusters the only thing that changes is the environment vars secret:

---
apiVersion: v1
kind: Secret
metadata:
  name: env-vars
  namespace: kube-system
type: Opaque
data:
  KUBE_CLUSTER_NAME: {{ kubernetes_cluster_name | b64encode }}
  KUBE_ARK_REPO_URL: {{ kubernetes_ark_repo_url | b64encode }} # hardcoded static var
  KUBE_SLACK_WEBHOOK_URL: {{ kubernetes_slack_webhook_url | b64encode }} # hardcoded static var
  KUBE_SLACK_CHANNEL: {{ kubernetes_slack_channel | b64encode }}

when kubernetes_slack_channel is "#k8s_{{ kubernetes_cluster_name.split('.')[0] }}_events"

from kube-slack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.