---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: spack-io-updater
  namespace: spack
spec:
  schedule: "0 */6 * * *"
  jobTemplate:
    metadata:
      labels:
        app: spack-io
        svc: updater
    spec:
      template:
        metadata:
          labels:
            app: spack-io
            svc: updater
        spec:
          serviceAccountName: spack-io-updater
          restartPolicy: OnFailure
          containers:
          - name: updater
            image: "busybox"
            imagePullPolicy: IfNotPresent
            args: ["/update/script"]
            volumeMounts:
              - name: update
                mountPath: "/update"
          volumes:
            - name: update
              configMap:
                name: spack-io-updater
                defaultMode: 0700
          nodeSelector:
            spack.io/node-pool: base
