Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 :)

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)