apiVersion: batch/v1
kind: CronJob
metadata:
  name: reminder
spec:
  schedule: "0 12 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: reminder
            image: lnsth/todo-app-reminder:exercise_2.09
            env:
            - name: spring.datasource.url
              valueFrom:
                secretKeyRef:
                  name: todoapp-postgress-secret
                  key: spring.datasource.url
            - name: spring.datasource.username
              valueFrom:
                secretKeyRef:
                  name: todoapp-postgress-secret
                  key: POSTGRES_USER
            - name: spring.datasource.password
              valueFrom:
                secretKeyRef:
                  name: todoapp-postgress-secret
                  key: POSTGRES_PASSWORD   
          restartPolicy: Never


