apiVersion: apps/v1
kind: Deployment
metadata:
  name: druid-broker
  namespace: druid
  labels:
    component: broker
spec:
  replicas: 1
  selector:
    matchLabels:
      component: broker
  template:
    metadata:
      labels:
        component: broker
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8000"
    spec:
      containers:
        - name: druid
          image: gcr.io/zenatix-data-archiver/kube-druid:0.0.1
          imagePullPolicy: IfNotPresent
          command:
            - /bin/bash
            - -c
            - ip=$(awk 'END{print $1}' /etc/hosts) && sed -ri 's/druid.host=.*/druid.host='${ip}'/g' /druid/conf/broker/runtime.properties && bin/run-druid broker /druid/conf
          ports:
            - name: http
              containerPort: 8082
              protocol: TCP
#          livenessProbe:
#            initialDelaySeconds: 60
#            httpGet:
#              path: /status/health
#              port: 8082
          readinessProbe:
            initialDelaySeconds: 30
            httpGet:
              path: /status/health
              port: 8082
          volumeMounts:
          - mountPath: /var/druid/
            name: data
        - name: druid-exporter
          image: deepaksood619/druid-exporter:0.0.2
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 8000
              protocol: TCP
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: "druid-pvc"