Skip to content

Commit

Permalink
chore: Add weekly cron job for updating index (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
microamp authored Aug 15, 2024
1 parent c335d04 commit 13c2aa2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions k8s/iabweb/cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: cron-weekly
spec:
schedule: "30 0 * * 0" # "At 00:30 on Sunday."
timeZone: "Etc/UTC"
concurrencyPolicy: Forbid # No concurrent runs
jobTemplate:
spec:
backoffLimit: 0 # No retries
template:
spec:
restartPolicy: Never
containers:
- name: cron-weekly
image: "ghcr.io/ietf-tools/www:$APP_IMAGE_TAG"
imagePullPolicy: Always
volumeMounts:
- name: iabwww-cfg
mountPath: /app/ietf/settings/local.py
subPath: local.py
env:
- name: "DJANGO_SETTINGS_MODULE"
value: "ietf.settings.production"
# ensures the pod gets recreated on every deploy:
- name: "DEPLOY_UID"
value: "$DEPLOY_UID"
envFrom:
- secretRef:
name: iabwww-secrets-env
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsUser: 1000
runAsGroup: 1000
command: ["python", "/app/manage.py", "update_index"]
volumes:
- name: iabwww-cfg
configMap:
name: files-cfgmap
1 change: 1 addition & 0 deletions k8s/iabweb/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ configMapGenerator:
resources:
- memcached.yaml
- wagtail.yaml
- cron.yaml

0 comments on commit 13c2aa2

Please sign in to comment.