K8s cronjob for resetting the database on staging.
This K8s CronJob will run the script for resetting the database. It will only be applied to the staging site.
This commit is contained in:
parent
3a6120fb5a
commit
9d282ee82a
@ -84,8 +84,7 @@ COPY --from=builder /install/celery_worker.py ./celery_worker.py
|
|||||||
COPY --from=builder /install/config/ ./config/
|
COPY --from=builder /install/config/ ./config/
|
||||||
COPY --from=builder /install/templates/ ./templates/
|
COPY --from=builder /install/templates/ ./templates/
|
||||||
COPY --from=builder /install/translations.yaml .
|
COPY --from=builder /install/translations.yaml .
|
||||||
COPY --from=builder /install/script/seed_roles.py ./script/seed_roles.py
|
COPY --from=builder /install/script/ ./script/
|
||||||
COPY --from=builder /install/script/sync-crls ./script/sync-crls
|
|
||||||
COPY --from=builder /install/static/ ./static/
|
COPY --from=builder /install/static/ ./static/
|
||||||
COPY --from=builder /install/fixtures/ ./fixtures
|
COPY --from=builder /install/fixtures/ ./fixtures
|
||||||
COPY --from=builder /install/uwsgi.ini .
|
COPY --from=builder /install/uwsgi.ini .
|
||||||
|
@ -3,6 +3,7 @@ bases:
|
|||||||
- ../../azure/
|
- ../../azure/
|
||||||
resources:
|
resources:
|
||||||
- namespace.yml
|
- namespace.yml
|
||||||
|
- reset-cron-job.yml
|
||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
- replica_count.yml
|
- replica_count.yml
|
||||||
- ports.yml
|
- ports.yml
|
||||||
|
46
deploy/overlays/staging/reset-cron-job.yml
Normal file
46
deploy/overlays/staging/reset-cron-job.yml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: batch/v1beta1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: reset-db
|
||||||
|
namespace: atat
|
||||||
|
spec:
|
||||||
|
schedule: "0 4 * * *"
|
||||||
|
concurrencyPolicy: Replace
|
||||||
|
successfulJobsHistoryLimit: 1
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: atst
|
||||||
|
role: reset-db
|
||||||
|
aadpodidbinding: atat-kv-id-binding
|
||||||
|
spec:
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
containers:
|
||||||
|
- name: reset
|
||||||
|
image: $CONTAINER_IMAGE
|
||||||
|
command: [
|
||||||
|
"/bin/sh", "-c"
|
||||||
|
]
|
||||||
|
args: [
|
||||||
|
"/opt/atat/atst/.venv/bin/python",
|
||||||
|
"/opt/atat/atst/script/reset_database.py"
|
||||||
|
]
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: atst-worker-envvars
|
||||||
|
volumeMounts:
|
||||||
|
- name: flask-secret
|
||||||
|
mountPath: "/config"
|
||||||
|
volumes:
|
||||||
|
- name: flask-secret
|
||||||
|
flexVolume:
|
||||||
|
driver: "azure/kv"
|
||||||
|
options:
|
||||||
|
usepodidentity: "true"
|
||||||
|
keyvaultname: "atat-vault-test"
|
||||||
|
keyvaultobjectnames: "staging-AZURE-STORAGE-KEY;staging-MAIL-PASSWORD;staging-PGPASSWORD;staging-REDIS-PASSWORD;staging-SECRET-KEY"
|
||||||
|
keyvaultobjectaliases: "AZURE_STORAGE_KEY;MAIL_PASSWORD;PGPASSWORD;REDIS_PASSWORD;SECRET_KEY"
|
||||||
|
keyvaultobjecttypes: "secret;secret;secret;secret;key"
|
||||||
|
tenantid: $TENANT_ID
|
Loading…
x
Reference in New Issue
Block a user