apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: query-cache
    app.kubernetes.io/instance: observatorium-xyz
    app.kubernetes.io/name: thanos-query-frontend
    app.kubernetes.io/part-of: observatorium
    app.kubernetes.io/version: master-2020-11-04-a4576d85
  name: observatorium-xyz-thanos-query-frontend
  namespace: observatorium
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: query-cache
      app.kubernetes.io/instance: observatorium-xyz
      app.kubernetes.io/name: thanos-query-frontend
      app.kubernetes.io/part-of: observatorium
  template:
    metadata:
      labels:
        app.kubernetes.io/component: query-cache
        app.kubernetes.io/instance: observatorium-xyz
        app.kubernetes.io/name: thanos-query-frontend
        app.kubernetes.io/part-of: observatorium
        app.kubernetes.io/version: master-2020-11-04-a4576d85
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - thanos-query-frontend
              namespaces:
              - observatorium
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
      - args:
        - query-frontend
        - --query-frontend.compress-responses
        - --http-address=0.0.0.0:9090
        - --query-frontend.downstream-url=http://observatorium-xyz-thanos-query.observatorium.svc.cluster.local.:9090
        - --query-range.split-interval=24h
        - --labels.split-interval=24h
        - --query-range.max-retries-per-request=0
        - --labels.max-retries-per-request=0
        - --query-frontend.log-queries-longer-than=5s
        - |-
          --query-range.response-cache-config="config":
            "addresses":
            - "dnssrv+_client._tcp.observatorium-xyz-thanos-query-frontend-memcached.observatorium.svc"
            "dns_provider_update_interval": "10s"
            "max_async_buffer_size": 10000
            "max_async_concurrency": 20
            "max_get_multi_batch_size": 0
            "max_get_multi_concurrency": 100
            "max_idle_connections": 100
            "timeout": "500ms"
          "type": "memcached"
        - |-
          --labels.response-cache-config="config":
            "addresses":
            - "dnssrv+_client._tcp.observatorium-xyz-thanos-query-frontend-memcached.observatorium.svc"
            "dns_provider_update_interval": "10s"
            "max_async_buffer_size": 10000
            "max_async_concurrency": 20
            "max_get_multi_batch_size": 0
            "max_get_multi_concurrency": 100
            "max_idle_connections": 100
            "timeout": "500ms"
          "type": "memcached"
        image: quay.io/thanos/thanos:master-2020-11-04-a4576d85
        livenessProbe:
          failureThreshold: 4
          httpGet:
            path: /-/healthy
            port: 9090
            scheme: HTTP
          periodSeconds: 30
        name: thanos-query-frontend
        ports:
        - containerPort: 9090
          name: http
        readinessProbe:
          failureThreshold: 20
          httpGet:
            path: /-/ready
            port: 9090
            scheme: HTTP
          periodSeconds: 5
        resources: {}
        terminationMessagePolicy: FallbackToLogsOnError
      terminationGracePeriodSeconds: 120
