https://github.com/shotakitazawa/manytimesjob
Kubernetes Controller for applying job of same name more than once.
https://github.com/shotakitazawa/manytimesjob
Last synced: 4 months ago
JSON representation
Kubernetes Controller for applying job of same name more than once.
- Host: GitHub
- URL: https://github.com/shotakitazawa/manytimesjob
- Owner: ShotaKitazawa
- License: apache-2.0
- Created: 2020-02-24T02:56:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-24T09:18:00.000Z (over 5 years ago)
- Last Synced: 2025-01-08T11:48:09.956Z (6 months ago)
- Language: Go
- Homepage:
- Size: 85.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# manytimesjob
Kubernetes Controller for applying job of same name more than once.
## Install
```
# controller
kubectl apply -f manifest.yaml -n default# rbac
kubectl kustomize config/rbac | kubectl apply -f -
```## Demo
1. apply ManyTimesJob Resource * 4
```
kubectl apply -f config/samples/batch_v1alpha1_manytimesjob.yaml
kubectl apply -f config/samples/batch_v1alpha1_manytimesjob.yaml
kubectl apply -f config/samples/batch_v1alpha1_manytimesjob.yaml
kubectl apply -f config/samples/batch_v1alpha1_manytimesjob.yaml
```2. get Job Resource
```
$ kubectl get job
NAME COMPLETIONS DURATION AGE
test-1582530561 1/1 15s 8m20s
test-1582531041 1/1 15s 30s
test-1582531047 1/1 15s 24s
test-1582531048 1/1 15s 23s
```3. apply ManyTimesJob Resource
```
kubectl apply -f config/samples/batch_v1alpha1_manytimesjob.yaml
```4. get Job Resource
* deleted oldest Job resource!```
$ kubectl get job
NAME COMPLETIONS DURATION AGE
test-1582531041 1/1 15s 32s
test-1582531047 1/1 15s 26s
test-1582531048 1/1 15s 25s
test-1582531072 0/1 1s 1s
```