apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: query-layer
    app.kubernetes.io/instance: benchmark-thanos-query
    app.kubernetes.io/name: thanos-query
    app.kubernetes.io/part-of: telemeter-benchmark
    app.kubernetes.io/version: master-2020-02-13-adfef4b5
  name: benchmark-thanos-query
  namespace: telemeter-benchmark
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: query-layer
      app.kubernetes.io/instance: benchmark-thanos-query
      app.kubernetes.io/name: thanos-query
      app.kubernetes.io/part-of: telemeter-benchmark
  template:
    metadata:
      labels:
        app.kubernetes.io/component: query-layer
        app.kubernetes.io/instance: benchmark-thanos-query
        app.kubernetes.io/name: thanos-query
        app.kubernetes.io/part-of: telemeter-benchmark
        app.kubernetes.io/version: master-2020-02-13-adfef4b5
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - thanos-query
              namespaces:
              - telemeter-benchmark
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
      - args:
        - query
        - --grpc-address=0.0.0.0:10901
        - --http-address=0.0.0.0:9090
        - --query.replica-label=prometheus_replica
        - --query.replica-label=ruler_replica
        - --query.replica-label=replica
        - --store=dnssrv+_grpc._tcp.benchmark-thanos-receive-default.telemeter-benchmark.svc.cluster.local
        image: quay.io/thanos/thanos:master-2020-02-13-adfef4b5
        livenessProbe:
          failureThreshold: 4
          httpGet:
            path: /-/healthy
            port: 9090
            scheme: HTTP
          periodSeconds: 30
        name: thanos-query
        ports:
        - containerPort: 10901
          name: grpc
        - containerPort: 9090
          name: http
        readinessProbe:
          failureThreshold: 20
          httpGet:
            path: /-/ready
            port: 9090
            scheme: HTTP
          periodSeconds: 5
        terminationMessagePolicy: FallbackToLogsOnError
      terminationGracePeriodSeconds: 120
