apiVersion: "v1"
kind: "Pod"
metadata:
  name: "az-template-example"
  namespace: "az-team"
spec:
  initContainers:
    - env:
        - name: CUSTOM_ENV
          value: customVal
      image: path/spark-jobtype:0.0.4
      imagePullPolicy: IfNotPresent
      name: jobtype-init-spark
      volumeMounts:
        - mountPath: /data/jobtypes/spark2
          name: jobtype-volume-spark
        - mountPath: /data/jobtypes/custom-spark
          name: jobtype-volume-custom-spark
    - name: chown-kubelet
      image: path/my-image:0.0.5
      command:
        - chown
        - "-R"
        - '1000'
        - "/var/run/kubelet/"
      securityContext:
        runAsUser: 0
      volumeMounts:
        - name: kubelet
          mountPath: "/var/run/kubelet"
  containers:
    - image: "path/azkaban-base-image:0.0.5"
      imagePullPolicy: "IfNotPresent"
      name: "az-flow-container"
      livenessProbe:
        exec:
          command:
            - cat
            - /tmp/liveProbe
        initialDelaySeconds: 5
        periodSeconds: 5
      readinessProbe:
        exec:
          command:
            - cat
            - /tmp/readyProbe
        initialDelaySeconds: 5
        periodSeconds: 5
      volumeMounts:
        - name: kubelet
          mountPath: "/var/run/kubelet"
        - name: jobtype-volume-custom-spark
          mountPath: "azBasePath/plugins/jobtypes/custom-spark"
  volumes:
    - emptyDir: {}
      name: jobtype-volume-spark
    - emptyDir: {}
      name: jobtype-volume-custom-spark
    - name: kubelet
      hostPath:
        path: /export/content/lid/apps/kubelet/i002/var
        type: Directory
