apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: prepuller
spec:
  schedule: "{{PREPULLER_MINUTE}} * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: "Never"
          serviceAccountName: prepuller
          securityContext:
            # Run as provisionator, not root.
            runAsUser: 769
            runAsGroup: 769
          containers:
            - name: prepuller
              imagePullPolicy: "Always"
              image: "lsstsqre/prepuller"
              env:
              - name: DEBUG
                value: "{{DEBUG}}"
              # image_list and no_scan can be used to completely replace
              #  the prepull repository scan with a static list of images.
              - name: PREPULLER_IMAGE_LIST
                value: "{{PREPULLER_IMAGE_LIST}}"
              - name: PREPULLER_NO_SCAN
                value: "{{PREPULLER_NO_SCAN}}"
              # Use the next three with your own image with an LSST/DM
              #  dated tag format ( [d|w][YYYYMMDD] or r[MajMin])
              - name: PREPULLER_REPO
                value: "{{PREPULLER_REPO}}"
              - name: PREPULLER_OWNER
                value: "{{PREPULLER_OWNER}}"
              - name: PREPULLER_IMAGE_NAME
                value: "{{PREPULLER_IMAGE_NAME}}"
              # Normally 0/3/2/1
              - name: PREPULLER_EXPERIMENTALS
                value: "{{PREPULLER_EXPERIMENTALS}}"
              - name: PREPULLER_DAILIES
                value: "{{PREPULLER_DAILIES}}"
              - name: PREPULLER_WEEKLIES
                value: "{{PREPULLER_WEEKLIES}}"
              - name: PREPULLER_RELEASES
                value: "{{PREPULLER_RELEASES}}"
              # Probably won't need to change any of these.
              - name: PREPULLER_INSECURE
                value: "{{PREPULLER_INSECURE}}"
              - name: PREPULLER_PORT
                value: "{{PREPULLER_PORT}}"
              - name: PREPULLER_SORT_FIELD
                value: "{{PREPULLER_SORT_FIELD}}"
              - name: PREPULLER_COMMAND
                value: "{{PREPULLER_COMMAND}}"
              - name: PREPULLER_NAMESPACE
                value: "{{PREPULLER_NAMESPACE}}"
              - name: ALLOW_DASK_SPAWN
                value: "{{ALLOW_DASK_SPAWN}}"
              - name: RESTRICT_LAB_NODES
                value: "{{RESTRICT_LAB_NODES}}"
              - name: RESTRICT_DASK_NODES
                value: "{{RESTRICT_DASK_NODES}}"
