# Copyright (c) 2021 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: snapshot-configurator
spec:
  schedule: '0 0 * * *'
  suspend: true
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: curator
              image: quay.io/sighup/curator
              resources:
                requests:
                  cpu: 100m
                  memory: 500Mi
                limits:
                  cpu: 300m
                  memory: 800Mi
              envFrom:
                - secretRef:
                    name: curator-aws
              command:
                - python
              args:
                - /scripts/add_task.py
              volumeMounts:
                - name: scripts
                  mountPath: /scripts
          restartPolicy: OnFailure
          volumes:
            - name: scripts
              configMap:
                name: task-scripts
