Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanata2/kubectl-jobnotify
This plugin is my first project in my k8s life. Just a toy :)
https://github.com/kanata2/kubectl-jobnotify
golang kubectl kubectl-plugins kubernete kubernetes-job
Last synced: about 1 month ago
JSON representation
This plugin is my first project in my k8s life. Just a toy :)
- Host: GitHub
- URL: https://github.com/kanata2/kubectl-jobnotify
- Owner: kanata2
- Created: 2019-08-14T09:31:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-15T03:56:47.000Z (over 5 years ago)
- Last Synced: 2024-10-14T21:48:21.608Z (3 months ago)
- Topics: golang, kubectl, kubectl-plugins, kubernete, kubernetes-job
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
kubectl-jobnotify
---This plugin make you notify k8s's job completion through some tools (currently only STDOUT, Slack).
However this is **just a toy**(i.e. not production-ready) for studying Kubernetes :)### Setup
$ go get [email protected]:kanata2/kubectl-jobnotify
$ make build
$ mv kubectl-jobnotify /path/to/bin
$ export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxxxxxx/xxxxxxx/xxxxxxx # need if you want to notify to Slack.### Usage
$ kubectl jobnotify --job -d
More info: `kubectl jobnotify help`
### Example
1. make job yaml and apply
```
$ cat < job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: sleeper
spec:
completions: 5
parallelism: 3
template:
spec:
containers:
- name: sleep
image: alpine
command: ["sh", "-c"]
args:
- |
sleep 3
restartPolicy: Never
YAML$ kubectl apply -f job.yaml
job.batch/sleeper created
```2. `$ kubectl jobnotify --job sleeper --destination slack`
3. notify to you
![result](https://user-images.githubusercontent.com/7460883/63013081-66434f00-bec6-11e9-8b9f-06231312f175.png)