browsertrix/chart/app-templates/background_job.yaml
Tessa Walsh 1b1819ba5a
Move org deletion to background job with access to backend ops classes (#2098)
This PR introduces background jobs that have full access to the backend
ops classes and moves the delete org job to a background job.
2024-10-10 14:41:05 -04:00

60 lines
1.3 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: "{{ id }}"
labels:
role: "background-job"
job_type: {{ job_type }}
btrix.org: {{ oid }}
spec:
ttlSecondsAfterFinished: 0
backoffLimit: 3
template:
spec:
restartPolicy: Never
priorityClassName: bg-job
podFailurePolicy:
rules:
- action: FailJob
onExitCodes:
containerName: btrixbgjob
operator: NotIn
values: [0]
volumes:
- name: ops-configs
secret:
secretName: ops-configs
containers:
- name: btrixbgjob
image: {{ backend_image }}
imagePullPolicy: {{ pull_policy }}
env:
- name: BG_JOB_TYPE
value: {{ job_type }}
- name: OID
value: {{ oid }}
envFrom:
- configMapRef:
name: backend-env-config
- secretRef:
name: mongo-auth
volumeMounts:
- name: ops-configs
mountPath: /ops-configs/
command: ["python3", "-m", "btrixcloud.main_bg"]
resources:
limits:
memory: "200Mi"
requests:
memory: "200Mi"
cpu: "50m"