apiVersion: batch/v1
kind: Job
metadata:
  name: ${JOB}
  namespace: ${NAMESPACE}
spec:
  template:
    spec:
      nodeSelector:
        ibm-cloud.kubernetes.io/worker-id: ${WORKER}
      priorityClassName: system-node-critical
      containers:
      - name: cp4i-updates
        image: registry.access.redhat.com/ubi8/ubi:latest
        command:
        - /bin/bash
        - /scripts/update-all.sh
        volumeMounts:
        - name: host
          mountPath: /host
        - name: scripts
          mountPath: /scripts
        securityContext:
          privileged: true
          runAsUser: 0
      volumes:
      - name: host
        hostPath:
          path: /
      - name: scripts
        configMap:
          name: ${CONFIG_MAP}
      restartPolicy: Never