# infrastructure/longhorn/core/longhorn-disk-tags-ensure-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: longhorn-disk-tags-ensure-4
  namespace: longhorn-system
spec:
  backoffLimit: 0
  ttlSecondsAfterFinished: 3600
  template:
    spec:
      serviceAccountName: longhorn-service-account
      restartPolicy: Never
      volumes:
        - name: longhorn-disk-tags-ensure-script
          configMap:
            name: longhorn-disk-tags-ensure-script
            defaultMode: 0555
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values: ["arm64"]
                  - key: node-role.kubernetes.io/worker
                    operator: Exists
      containers:
        - name: apply
          image: python:3.12.9-alpine3.20
          command: ["python", "/scripts/longhorn_disk_tags_ensure.py"]
          volumeMounts:
            - name: longhorn-disk-tags-ensure-script
              mountPath: /scripts
              readOnly: true
