apiVersion: batch/v1
kind: Job
metadata:
  labels:
    app: migrations
  name: migrations
  namespace: static
spec:
  template:
    metadata:
      name: migrations
      labels:
        app: migrations
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: tenlastic.com/low-priority
                    operator: Exists
      containers:
        - name: migrations
          image: tenlastic/migrations:latest
          envFrom:
            - secretRef:
                name: nodejs-environment-variables
          resources:
            requests:
              cpu: 50m
      restartPolicy: OnFailure
