Koschei: create OpenShift Job object
This commit is contained in:
parent
01453fc961
commit
ec30d2cf89
2 changed files with 37 additions and 0 deletions
|
@ -55,6 +55,19 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
|
|
||||||
|
- name: Apply Job
|
||||||
|
include_role: name=openshift/object
|
||||||
|
vars:
|
||||||
|
template: job.yml
|
||||||
|
objectname: "{{ item.name }}-job.yml"
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
command: "{{ item.command }}"
|
||||||
|
with_items:
|
||||||
|
- name: db-create
|
||||||
|
command: "koschei-admin create-db && koschei-admin create-collection f29 --display-name 'Fedora Rawhide' --target f29 --bugzilla-product Fedora --bugzilla-version rawhide && koschei-admin create-group php"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
|
|
||||||
- name: Apply CronJob
|
- name: Apply CronJob
|
||||||
include_role: name=openshift/object
|
include_role: name=openshift/object
|
||||||
vars:
|
vars:
|
||||||
|
|
24
roles/openshift-apps/koschei/templates/job.yml
Normal file
24
roles/openshift-apps/koschei/templates/job.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: "job-{{name}}"
|
||||||
|
spec:
|
||||||
|
parallelism: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: "job-{{name}}"
|
||||||
|
image: quay.io/koschei/koschei:latest
|
||||||
|
command: ["/bin/bash", "-euxc", "{{command}}"]
|
||||||
|
env:
|
||||||
|
- name: SUDO_USER
|
||||||
|
value: "job-{{name}}"
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /etc/koschei
|
||||||
|
readOnly: true
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
secret:
|
||||||
|
secretName: backend-config
|
Loading…
Add table
Add a link
Reference in a new issue