Commit f440c1b0 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Add upgrade and backup

parent 8e7356b5098e
......@@ -55,6 +55,24 @@ spec:
- name: bfss
persistentVolumeClaim:
claimName: fresh
- name: backup
persistentVolumeClaim:
claimName: backup
initContainers:
- name: upgrade
image: r.intra.logilab.fr/intranet/fresh
imagePullPolicy: Always
command: ["cubicweb-ctl", "upgrade", "--backup-db=y", "--force", "--verbosity=0", "fresh"]
envFrom:
- secretRef:
name: fresh-env
resources:
requests:
cpu: 50m
memory: 500Mi
volumeMounts:
- name: backup
mountPath: /etc/cubicweb.d/fresh/backup
containers:
- name: fresh
image: r.intra.logilab.fr/intranet/fresh
......@@ -69,6 +87,8 @@ spec:
mountPath: /secret
- name: bfss
mountPath: /etc/cubicweb.d/fresh/bfss
- name: backup
mountPath: /etc/cubicweb.d/fresh/backup
command: [
"/bin/sh", "-c",
"install -m 400 /secret/cwclientlibrc /etc/cubicweb.d/fresh/cwclientlibrc && exec /entrypoint.sh start"
......@@ -160,3 +180,38 @@ spec:
ports:
- protocol: TCP
port: 8000
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: fresh-backup
spec:
schedule: "0 6 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
metadata:
labels:
app: fresh
spec:
restartPolicy: Never
volumes:
- name: backup
persistentVolumeClaim:
claimName: backup
containers:
- name: fresh
image: r.intra.logilab.fr/intranet/fresh
imagePullPolicy: Always
command: ["cubicweb-ctl", "db-dump", "fresh"]
envFrom:
- secretRef:
name: fresh-env
volumeMounts:
- name: backup
mountPath: /etc/cubicweb.d/fresh/backup
resources:
requests:
cpu: 50m
memory: 500Mi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment