apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: forecast-train-cronjob
spec:
  successfulJobsHistoryLimit: 3
  schedule: "5 0 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: forecast-train-job
            image: gwdowner/forecastservice:latest
            command: ["python",  "train.py"]
            imagePullPolicy: Always
            envFrom:
            - secretRef:
                name: forecast-service
          restartPolicy: OnFailure