apiVersion: batch/v1
kind: Job
metadata:
  name: hdfs-setup
spec:
  template:
    spec:
      initContainers:
      - name: wait-for-namenode
        image: zookage-util
        args:
        - wait-for-rollout
        - statefulset/hdfs-namenode
      containers:
      - name: setup
        image: zookage-util
        args:
        - hdfs-setup
        envFrom:
        - configMapRef:
            name: hadoop-env
        securityContext:
          runAsUser: 1011
          runAsGroup: 1010
        volumeMounts:
        - name: hadoop-conf
          mountPath: /etc/hadoop/conf
      restartPolicy: Never
      volumes:
      - name: hadoop-conf
        configMap:
          name: hadoop-conf
      - name: mnt
        emptyDir: {}
