ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
.k8s/live/cron_jobs/archive_stale.yaml

Summary

Maintainability
Test Coverage
apiVersion: batch/v1
kind: CronJob
metadata:
  name: cccd-archive-stale
spec:
  schedule: "5 0 * * *"
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 3
  startingDeadlineSeconds: 300
  jobTemplate:
    spec:
      backoffLimit: 0
      template:
        metadata:
          labels:
            tier: worker
        spec:
          serviceAccountName: cccd-production-service
          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
              - claims:archive_stale

            envFrom:
            - configMapRef:
                name: cccd-app-config
            - secretRef:
                name: cccd-secrets

            env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: cccd-rds
                  key: url
            - name: SETTINGS__AWS__S3__BUCKET
              valueFrom:
                secretKeyRef:
                  name: cccd-s3-bucket
                  key: bucket_name
            - name: REDIS_URL
              valueFrom:
                secretKeyRef:
                  name: cccd-elasticache-redis
                  key: url