apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: tidywallet
spec:
  schedule: "0/15 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: tidywallet
            image: funkypenguin/grinpool-services
            #command: ["sleep", "999"]
            command: ["/usr/local/bin/tidyWallet.py"]
            env:
            - name: WALLET_OWNER_API_USER
              valueFrom:
                secretKeyRef:
                  name: wallet-owner-api
                  key: username.txt
            - name: WALLET_OWNER_API_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: wallet-owner-api
                  key: password.txt
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql-pass
                  key: password
          restartPolicy: Never
          imagePullSecrets:
          - name: regsecret
  concurrencyPolicy: Replace
  successfulJobsHistoryLimit: 0
  failedJobsHistoryLimit: 1
