
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: hbase-region
spec:
  serviceName: hbase-region
  replicas: 3
  selector:
    matchLabels:
      app: hbase
      component: region
  podManagementPolicy: Parallel
  template:
    metadata:
      labels:
        app: hbase
        component: region
    spec:
      containers:
      - name: hbase-region
        image: flokkr/hbase
        args:
        - hbase
        - regionserver
        - start
        volumeMounts:
        - name: data
          mountPath: /data
        - name: ozonefs
          mountPath: /opt/ozonefs
        envFrom:
        - configMapRef:
            name: hbase-config
        - configMapRef:
            name: ozone-client-config
        env:
        - name: HADOOP_CLASSPATH
          value: /opt/ozonefs/hadoop-ozone-filesystem.jar
      volumes:
      - name: config
        configMap:
          name: hbase-config
      - name: data
        emptyDir: {}
      - name: ozonefs
        emptyDir: {}
      initContainers:
      - name: ozonefscopy
        image: flokkr/ozone
        command:
        - bash
        - -c
        - cp share/ozone/lib/hadoop-ozone-filesystem-hadoop2-*.jar /opt/ozonefs/hadoop-ozone-filesystem.jar
        volumeMounts:
        - name: ozonefs
          mountPath: /opt/ozonefs
        envFrom:
        - configMapRef:
            name: ozone-client-config
