Merge branch 'topic/default/deploy-move-backup-cronjob' into 'branch/default'
authorArthur Lutz <alutz@logilab.fr>
Fri, 18 Sep 2020 12:55:24 +0000
changeset 139 3fbb38d8e9c3
parent 138 c1967d47e690 (current diff)
parent 137 774311c0e28c (diff)
child 140 2aabf2606a06
Merge branch 'topic/default/deploy-move-backup-cronjob' into 'branch/default' [deploy] Move daily backup CronJob into a separate file See merge request cubicweb/cubes/fresh!2
--- a/MANIFEST.in	Thu Sep 17 22:52:24 2020 +0200
+++ b/MANIFEST.in	Fri Sep 18 12:55:24 2020 +0000
@@ -13,3 +13,4 @@
 recursive-include deploy *.yaml
 prune debian
 exclude .gitlab-ci.yml
+prune deploy
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/README	Fri Sep 18 12:55:24 2020 +0000
@@ -0,0 +1,2 @@
+deployment.yaml is used to deploy fresh on Kubernetes.
+backup.yaml defines a CronJob for daily backup of the database, it is optional.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/backup.yaml	Fri Sep 18 12:55:24 2020 +0000
@@ -0,0 +1,34 @@
+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
--- a/deploy/deployment.yaml	Thu Sep 17 22:52:24 2020 +0200
+++ b/deploy/deployment.yaml	Fri Sep 18 12:55:24 2020 +0000
@@ -180,38 +180,3 @@
   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