apiVersion: batch/v1 kind: Job metadata: name: "{{ id }}" labels: role: "background-job" job_type: {{ job_type }} {% if oid %} btrix.org: {{ oid }} {% endif %} spec: ttlSecondsAfterFinished: 90 backoffLimit: 3 {% if scale %} parallelism: {{ scale }} {% endif %} 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 }} {% if oid %} - name: OID value: {{ oid }} {% endif %} - name: CRAWL_TYPE value: {{ crawl_type }} {% if crawl_id %} - name: CRAWL_ID value: {{ crawl_id }} {% endif %} 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: "500Mi" requests: memory: "250Mi" cpu: "200m"