Planet: Add cronjob and PVC
Signed-off-by: Pedro Moura <pmoura@redhat.com>
This commit is contained in:
parent
aa56a6bb45
commit
1a34942c79
4 changed files with 84 additions and 0 deletions
|
@ -73,3 +73,8 @@
|
|||
app: planet
|
||||
template: deployment.yml
|
||||
objectname: deployment.yml
|
||||
|
||||
- role: openshift/object
|
||||
app: planet
|
||||
template: cronjob.yml
|
||||
objectname: cronjob.yml
|
||||
|
|
11
roles/openshift-apps/planet/files/pvc.yml
Normal file
11
roles/openshift-apps/planet/files/pvc.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: planet-http-storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 50Mi
|
||||
storageClassName: ocs-storagecluster-cephfs
|
62
roles/openshift-apps/planet/templates/cronjob.yml
Normal file
62
roles/openshift-apps/planet/templates/cronjob.yml
Normal file
|
@ -0,0 +1,62 @@
|
|||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: build-planet
|
||||
namespace: planet
|
||||
spec:
|
||||
schedule: '*/5 * * * *'
|
||||
concurrencyPolicy: Forbid
|
||||
suspend: false
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
metadata:
|
||||
name: build-planet
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: build-planet
|
||||
image: image-registry.openshift-image-registry.svc:5000/planet/planet:latest
|
||||
command: ["/bin/bash", "-c"]
|
||||
# Running build_planet.py twice to bypass undefined method error
|
||||
args:
|
||||
- |
|
||||
/usr/bin/python3 /pluto/build_planet.py
|
||||
/usr/bin/python3 /pluto/build_planet.py
|
||||
env:
|
||||
- name: KRB5_CONFIG
|
||||
value: '/etc/krb5/krb5.conf'
|
||||
- name: KRB5_CLIENT_KTNAME
|
||||
value: '/etc/keytabs/http'
|
||||
- name: KRB5CCNAME
|
||||
value: '/tmp/ccache'
|
||||
volumeMounts:
|
||||
- name: keytab-volume
|
||||
mountPath: /etc/keytabs/http
|
||||
subPath: http
|
||||
readOnly: true
|
||||
- name: krb-config-volume
|
||||
mountPath: /etc/krb5
|
||||
readOnly: true
|
||||
- name: ipa-config-volume
|
||||
mountPath: /etc/ipa
|
||||
readOnly: true
|
||||
- name: planet-build-storage
|
||||
mountPath: /var/www/html
|
||||
readOnly: false
|
||||
volumes:
|
||||
- name: keytab-volume
|
||||
secret:
|
||||
secretName: planet-keytab-http
|
||||
- name: krb-config-volume
|
||||
configMap:
|
||||
name: krb5-config
|
||||
- name: ipa-config-volume
|
||||
configMap:
|
||||
name: ipa-client-config
|
||||
- name: planet-build-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: planet-http-storage
|
||||
restartPolicy: OnFailure
|
||||
terminationGracePeriodSeconds: 30
|
|
@ -41,6 +41,9 @@ spec:
|
|||
- name: ipa-config-volume
|
||||
mountPath: /etc/ipa
|
||||
readOnly: true
|
||||
- name: planet-build-storage
|
||||
mountPath: /var/www/html
|
||||
readOnly: false
|
||||
volumes:
|
||||
- name: keytab-volume
|
||||
secret:
|
||||
|
@ -51,3 +54,6 @@ spec:
|
|||
- name: ipa-config-volume
|
||||
configMap:
|
||||
name: ipa-client-config
|
||||
- name: planet-build-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: planet-http-storage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue