---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: querier
  labels:
    app: querier
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: querier
  template:
    metadata:
      labels:
        app: querier
        gossip_ring_member: "true"
      annotations:
        prometheus.io.scrape: "true"
        prometheus.io.port: "80"
    spec:
      containers:
      - name: querier
        image: quay.io/cortexproject/cortex
        imagePullPolicy: IfNotPresent
        env:
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        args:
        - -target=querier
        - -config.file=/etc/cortex/cortex.yaml
        - -log.level=info
        - -memberlist.bind-addr=$(POD_IP)
        readinessProbe:
          httpGet:
            path: /ready
            port: http-metrics
          initialDelaySeconds: 45
        ports:
        - containerPort: 80
          name: http-metrics
        - containerPort: 9095
          name: grpc-querier
        volumeMounts:
        - mountPath: /etc/cortex
          name: cortex-config
        - mountPath: /var/cortex
          name: runtime-config
      terminationGracePeriodSeconds: 180
      volumes:
      - name: cortex-config
        secret:
          secretName: cortex-config
      - name: runtime-config
        configMap:
          name: runtime-config