apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: redeemer
spec:
  schedule: "0 1 * * *" # every day
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: redeemer
              image: skarlso/kube-redeemer:0.0.2
              env:
                - name: MYSQL_CONNECTION
                  value: "mysql.default.svc.cluster.local"
                - name: MYSQL_USERPASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: kube-face-secret
                      key: mysql_userpassword
                - name: MYSQL_PORT
                  value: "3306"
                - name: MYSQL_DBNAME
                  value: kube
                - name: PRODUCER_ADDRESS
                  value: "nsqd.default.svc.cluster.local:4150"
          restartPolicy: OnFailure
