Sign inSign up

mpatters72/kube-cron-slack

By mpatters72

•Updated about 8 years ago

Simple NodeJS image that posts environment var info to slack, in particular Kubernetes ENV variables

Image
0

10K+

mpatters72/kube-cron-slack repository overview

⁠kube-cron-slack

Kubernetes Slack Notification Cron Job POC

⁠DockerHub Image

https://hub.docker.com/r/mpatters72/kube-cron-slack/⁠

⁠Create a Slack Webhook URI

https://my.slack.com/services/new/incoming-webhook⁠

⁠Setup Secrets

⁠Copy Template
cp templates/kube-cron-slack-secret.yaml /tmp/
⁠Get base64 encoded values

https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-manually⁠

  • Use the webhook URI you generated here and your desired slack channel
echo -n 'https://hooks.slack.com/services/UseYour/RealChannel/URIHERE' | base64
aHR0cHM6Ly9ob29rcy5zbGFjay5jb20vc2VydmljZXMvVXNlWW91ci9SZWFsQ2hhbm5lbC9VUklIRVJF
echo -n '#my-slack-channel' | base64
I215LXNsYWNrLWNoYW5uZWw=
⁠Replace base64 files in new file secrets/kube-cron-slack-secret.yaml
⁠Add secret to kubernetes
kubectl apply -f /tmp/kube-cron-slack-secret.yaml

Verify

kubectl get secret kube-cron-slack -o yaml

⁠Setup CronJob

⁠Double-check settings in templates/kube-cron-slack-cronjob
⁠Copy template and make any desired edits and apply it
cp templates/kube-cron-slack-cronjob.yaml /tmp
# make any edits to /tmp/kube-cron-slack-cronjob.yaml
# apply it
kubectl apply -f /tmp/kube-cron-slack-cronjob.yaml
⁠Troubleshooting
kubectl get cronjob
kubectl get jobs --watch

Tag summary

Content type

Image

Digest

Size

25.8 MB

Last updated

about 8 years ago

docker pull mpatters72/kube-cron-slack