apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app: druid
    druid_cr: druid-test
    nodeSpecUniqueStr: druid-druid-test-brokers
  name: druid-druid-test-brokers
  namespace: test-namespace
  annotations:
    druidOpResourceHash: 9GZp2OIKjL1N4ns2dkviiChhWLw=
spec:
  podManagementPolicy: Parallel
  replicas: 2
  selector:
    matchLabels:
      app: druid
      druid_cr: druid-test
      nodeSpecUniqueStr: druid-druid-test-brokers
  serviceName: druid-druid-test-brokers
  template:
    metadata:
      labels:
        app: druid
        druid_cr: druid-test
        nodeSpecUniqueStr: druid-druid-test-brokers
      annotations:
        key1: value1
        key2: value2
    spec:
      containers:
      - command:
        - bin/run-druid.sh
        - broker
        image: himanshu01/druid:druid-0.12.0-1
        name: druid-druid-test-brokers
        env:
          - name : configMapSHA
            value : blah
        ports:
        - containerPort: 8083
          name: random
        readinessProbe:
          httpGet:
            path: /status
            port: 8080
        livenessProbe:
          httpGet:
            path: /status
            port: 8080
        resources:
          limits:
            cpu: "4"
            memory: 2Gi
          requests:
            cpu: "4"
            memory: 2Gi
        volumeMounts:
        - mountPath: /druid/conf/druid/_common
          name: common-config-volume
        - mountPath: /druid/conf/druid/broker
          name: nodetype-config-volume
        - mountPath: /druid/data
          name: data-volume
      securityContext:
        fsGroup: 107
        runAsUser: 106
      volumes:
      - configMap:
          name: druid-test-druid-common-config
        name: common-config-volume
      - configMap:
          name: druid-druid-test-brokers-config
        name: nodetype-config-volume
  volumeClaimTemplates:
  - metadata:
      name: data-volume
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 2Gi
      storageClassName: gp2