
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: yarn-resourcemanager
  labels:
    app: yarn
    component: resourcemanager
spec:
  serviceName: yarn-resourcemanager
  replicas: 1
  updateStrategy:
    type: RollingUpdate
  podManagementPolicy: Parallel
  selector:
    matchLabels:
      app: yarn
      component: resourcemanager
  template:
    metadata:
      labels:
        app: yarn
        component: resourcemanager
    spec:
      containers:
      - name: yarn-resourcemanager
        image: flokkr/hadoop
        args:
        - yarn
        - resourcemanager
        envFrom:
        - configMapRef:
            name: yarn-config
        - configMapRef:
            name: ozone-client-config
        - configMapRef:
            name: ozone-config
        volumeMounts:
        - name: ozonefs
          mountPath: /opt/ozonefs
        env:
        - name: HADOOP_CLASSPATH
          value: /opt/ozonefs/hadoop-ozone-filesystem-lib-current-0.5.0-SNAPSHOT.jar
      volumes:
      - name: config
        configMap:
          name: yarn-config
      - name: data
        emptyDir: {}
      - name: ozonefs
        emptyDir: {}
      initContainers:
      - name: ozonefscopy
        image: elek/ozone:0.5.0-rc2-beta
        command:
        - bash
        - -c
        - cp /opt/ozone/share/ozone/lib/hadoop-ozone-filesystem-lib-current-0.5.0-SNAPSHOT.jar
          /opt/ozonefs
        volumeMounts:
        - name: ozonefs
          mountPath: /opt/ozonefs
        envFrom:
        - configMapRef:
            name: ozone-client-config
