Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acoshift/kjobrunner
Simplify Kubernetes API for run jobs
https://github.com/acoshift/kjobrunner
Last synced: 3 days ago
JSON representation
Simplify Kubernetes API for run jobs
- Host: GitHub
- URL: https://github.com/acoshift/kjobrunner
- Owner: acoshift
- License: mit
- Created: 2019-05-01T12:18:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-01T12:19:35.000Z (almost 6 years ago)
- Last Synced: 2024-12-05T01:25:47.875Z (2 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kjobrunner
Simplify Kubernetes API for run jobs
## Testing
```bash
# create namespace
$ kubectl create ns kjobrunner# create service account
$ kubectl create sa runner -n kjobrunner# grant service account permissions
$ cat << EOF | kubectl apply -f - -n kjobrunner
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: runner
rules:
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: runner
subjects:
- kind: ServiceAccount
name: runner
roleRef:
kind: Role
name: runner
apiGroup: rbac.authorization.k8s.io
EOF# run test
$ TOKEN=$(kubectl get sa/runner -ojson | jq '.secrets[0].name' -r | xargs kubectl get secret -ojson | jq '.data.token' -r | base64 -D) go test .
```