apiVersion: apps/v1
kind: Deployment
metadata:
  name: hive-hiveserver2
spec:
  replicas: 1
  selector:
    matchLabels: {}
  template:
    spec:
      initContainers:
      - name: wait-for-metastore
        image: zookage-util
        args:
        - wait-for-rollout
        - statefulset/hive-metastore
      containers:
      - name: hiveserver2
        image: zookage-util
        command:
        - /opt/hive/bin/hiveserver2
        envFrom:
        - configMapRef:
            name: hadoop-env
        - configMapRef:
            name: hive-env
        - configMapRef:
            name: tez-env
        env:
        - name: HADOOP_CLASSPATH
          value: $(TEZ_CONF_DIR):$(TEZ_JARS)/*:$(TEZ_JARS)/lib/*
        readinessProbe:
          tcpSocket:
            port: 10000
        securityContext:
          runAsUser: 1020
          runAsGroup: 1020
        volumeMounts:
        - name: hadoop-conf
          mountPath: /etc/hadoop/conf
        - name: hive-conf
          mountPath: /etc/hive/conf
        - name: tez-conf
          mountPath: /etc/tez/conf
        - name: package-hadoop
          mountPath: /opt/hadoop
        - name: package-hive
          mountPath: /opt/hive
        - name: package-tez
          mountPath: /opt/tez
      terminationGracePeriodSeconds: 5
      volumes:
      - name: hadoop-conf
        configMap:
          name: hadoop-conf
      - name: hive-conf
        configMap:
          name: hive-conf
      - name: tez-conf
        configMap:
          name: tez-conf
      - name: package-hadoop
        persistentVolumeClaim:
          claimName: package-hadoop
      - name: package-hive
        persistentVolumeClaim:
          claimName: package-hive
      - name: package-tez
        persistentVolumeClaim:
          claimName: package-tez
