apiVersion: batch/v1beta1
kind: CronJob
metadata:
  namespace: gcs-smart-archive
  name: gcs-smart-archive
spec:
  concurrencyPolicy: Forbid
  # 10 am MST
  schedule: "0 16 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: gcs-smart-archive
          affinity:
            nodeAffinity:
              requiredDuringSchedulingIgnoredDuringExecution:
                nodeSelectorTerms:
                  - matchExpressions:
                    - key: cloud.google.com/gke-nodepool
                      operator: In
                      values:
                      - workload-identity-pool
          restartPolicy: Never
          tolerations:
          - effect: NoSchedule
            key: dedicated
            operator: Equal
            value: workload_identity
          containers:
          - name: gcs-smart-archive
            image: us.gcr.io/automatapolis/gcs-audit-log-smart-archive:0.0.4
            imagePullPolicy: Always
