apiVersion: batch/v1
kind: Job
metadata:
  name: node-tasker-job
  namespace: default
  labels:
    app.kubernetes.io/name: node-tasker
    app.kubernetes.io/component: node-tasker-job
spec:
  backoffLimit: 1
  template: 
    metadata:
      name: node-tasker-job
      labels:
        app.kubernetes.io/name: node-tasker
        app.kubernetes.io/component: node-tasker-job
    spec:
      restartPolicy: OnFailure
      activeDeadlineSeconds: 100
      containers:
      - name: job
        image: busybox
        imagePullPolicy: IfNotPresent
        command:
        - /run/task
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
        volumeMounts:
        - name: run
          mountPath: /run/task
          subPath: task
      volumes:
      - name: run
        configMap:
          name: node-tasker
          items:
          - key: task
            path: task
            mode: 0755
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - localhost