.k8s/live/cron_jobs/vacuum_db.yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: cccd-vacuum-db
spec:
schedule: "5 1 * * 0"
concurrencyPolicy: Forbid
startingDeadlineSeconds: 120
successfulJobsHistoryLimit: 2
failedJobsHistoryLimit: 2
jobTemplate:
spec:
backoffLimit: 3
template:
metadata:
labels:
tier: worker
spec:
restartPolicy: Never
containers:
- name: cronjob-worker
image: 754256621582.dkr.ecr.eu-west-2.amazonaws.com/laa-get-paid/cccd:app-latest
imagePullPolicy: Always
securityContext:
capabilities:
drop:
- ALL
runAsNonRoot: true
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
command:
- rails
- db:vacuum
envFrom:
- configMapRef:
name: cccd-app-config
- secretRef:
name: cccd-secrets
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: cccd-rds
key: url