apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: cronjob
spec:
  schedule: "0 1 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
          - name: robot-gitee-scavenger
            args:
            - --gitee-token-path=/app/conf/robot-gitee/robot_token
            - --config-file=/app/conf/robot-gitee/app_config.yaml
            image: swr.cn-north-4.myhuaweicloud.com/opensourceway/robot/robot-gitee:latest
            volumeMounts:
            - mountPath: /app/conf/robot-gitee/app_config.yaml
              subPath: config.yaml
              name: app-config
              readOnly: true
            - mountPath: /app/conf/robot-gitee/robot_token
              subPath: robot-token
              name: secret-volume
          volumes:
          - name: app-config
            configMap:
              name: configmap-scavenger
          - name: secret-volume
            secret:
              secretName: secret-robot-token