apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: blockvalidator
spec:
  schedule: "3 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: blockvalidator
            image: grinpool/services:latest
            command: ["/usr/local/bin/blockValidator.py"]
            env:
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql-pass
                  key: password
            volumeMounts: # directory inside container
            - mountPath: /services
              name: poolservicesdir
          volumes: # directory location on host
          - name: poolservicesdir
            hostPath:
              path: /data/services
#          imagePullSecrets:
#          - name: regsecret
          restartPolicy: Never
  concurrencyPolicy: Replace
  successfulJobsHistoryLimit: 0
  failedJobsHistoryLimit: 1
