apiVersion: batch/v1
kind: CronJob
metadata:
  name: build-sync-server
spec:
  schedule: "* * * * *"
  successfulJobsHistoryLimit: 3
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      # ttlSecondsAfterFinished: 100
      template:
        spec:
          containers:
            - name: build-sync-server
              image: nicklansley/gs1_digitallink_resolver_ce_build-sync-server: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
                - name: SQLDB_PROCESS_BATCH_SIZE
                  value: "1000"
                - name: BUILD_HOSTNAME
                  value: "build_syn_job"
              # command:
              # - /bin/sh
              # - -c
              # - date; echo test
          restartPolicy: Never