imfreedom/k8s-cluster

Parents ecd7f38cb534
Children 5b41605ec1ca
Add cronjobs for reviewboard to update the search index and clear expired sessions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/50-reviews.imfreedom.org/reviewboard/cron.yaml Mon Mar 14 23:45:35 2022 -0500
@@ -0,0 +1,74 @@
+---
+apiVersion: batch/v1
+kind: CronJob
+metadata:
+ name: reviews-reviewboard-update-search-index
+spec:
+ schedule: "*/10 * * * *"
+ concurrencyPolicy: Forbid
+ jobTemplate:
+ spec:
+ template:
+ spec:
+ containers:
+ - name: update-search-index
+ image: rwgrim/reviewboard-app:latest
+ imagePullPolicy: Always
+ command:
+ - "/venv/bin/python"
+ - "/venv/bin/rb-site"
+ - "manage"
+ - "/site"
+ - "update_index"
+ - "--"
+ - "--age"
+ - "1"
+ volumeMounts:
+ - mountPath: /site
+ name: reviews-reviewboard
+ readOnly: false
+ subPath: reviewboard
+ restartPolicy: OnFailure
+ securityContext:
+ runAsUser: 1001
+ runAsGroup: 1001
+ volumes:
+ - name: reviews-reviewboard
+ persistentVolumeClaim:
+ claimName: reviews-reviewboard
+---
+apiVersion: batch/v1
+kind: CronJob
+metadata:
+ name: reviews-reviewboard-clear-expired-sessions
+spec:
+ schedule: "0 6 * * *"
+ concurrencyPolicy: Forbid
+ jobTemplate:
+ spec:
+ template:
+ spec:
+ containers:
+ - name: clear-expired-sessions
+ image: rwgrim/reviewboard-app:latest
+ imagePullPolicy: Always
+ command:
+ - "/venv/bin/python"
+ - "/venv/bin/rb-site"
+ - "manage"
+ - "/site"
+ - "clearsessions"
+ volumeMounts:
+ - mountPath: /site
+ name: reviews-reviewboard
+ readOnly: false
+ subPath: reviewboard
+ restartPolicy: OnFailure
+ securityContext:
+ runAsUser: 1001
+ runAsGroup: 1001
+ volumes:
+ - name: reviews-reviewboard
+ persistentVolumeClaim:
+ claimName: reviews-reviewboard
+---
--- a/50-reviews.imfreedom.org/reviewboard/kustomization.yaml Mon Mar 07 03:01:08 2022 -0600
+++ b/50-reviews.imfreedom.org/reviewboard/kustomization.yaml Mon Mar 14 23:45:35 2022 -0500
@@ -14,4 +14,5 @@
role: reviewboard
resources:
- manifest.yaml
+ - cron.yaml
---