apiVersion: batch/v1
kind: CronJob
metadata:
  name: dashboard-sync-server
spec:
  schedule: "* */24 * * *"
  successfulJobsHistoryLimit: 3
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      # ttlSecondsAfterFinished: 100
      template:
        spec:
          containers:
            - name: dashboard-sync-server
              image:  nicklansley/gs1_digitallink_resolver_ce_dashboard-sync-service:v2.5.0
              imagePullPolicy: IfNotPresent
              env:
                - name: MONGODBCONN
                  value: "mongodb://gs1resolver:gs1resolver@resolver-mongo-service"
                - name: SQLDBCONN_USER
                  valueFrom:
                    secretKeyRef:
                      name: sqldbconn
                      key: user
                - name: SQLDBCONN_PASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: sqldbconn
                      key: password
                - name: SQLDBCONN_SERVER
                  valueFrom:
                    secretKeyRef:
                      name: sqldbconn
                      key: server
                - name: SQLDBCONN_DB
                  valueFrom:
                    secretKeyRef:
                      name: sqldbconn
                      key: database
          restartPolicy: Never
