apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/component: object-store-gateway
    app.kubernetes.io/instance: observatorium-xyz
    app.kubernetes.io/name: thanos-store
    app.kubernetes.io/part-of: observatorium
    app.kubernetes.io/version: master-2020-08-12-70f89d83
    store.observatorium.io/shard: shard-0
  name: observatorium-xyz-thanos-store-shard-0
  namespace: observatorium
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: object-store-gateway
      app.kubernetes.io/instance: observatorium-xyz
      app.kubernetes.io/name: thanos-store
      app.kubernetes.io/part-of: observatorium
      store.observatorium.io/shard: shard-0
  serviceName: observatorium-xyz-thanos-store-shard-0
  template:
    metadata:
      labels:
        app.kubernetes.io/component: object-store-gateway
        app.kubernetes.io/instance: observatorium-xyz
        app.kubernetes.io/name: thanos-store
        app.kubernetes.io/part-of: observatorium
        app.kubernetes.io/version: master-2020-08-12-70f89d83
        store.observatorium.io/shard: shard-0
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - thanos-store
                - key: app.kubernetes.io/instance
                  operator: In
                  values:
                  - observatorium-xyz
              namespaces:
              - observatorium
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
      - args:
        - store
        - --log.level=info
        - --data-dir=/var/thanos/store
        - --grpc-address=0.0.0.0:10901
        - --http-address=0.0.0.0:10902
        - --objstore.config=$(OBJSTORE_CONFIG)
        - --experimental.enable-index-cache-postings-compression
        - |-
          --index-cache.config="config":
            "addresses":
            - "dnssrv+_client._tcp.observatorium-xyz-thanos-store-memcached.observatorium.svc"
            "dns_provider_update_interval": "10s"
            "max_async_buffer_size": 100000
            "max_async_concurrency": 100
            "max_get_multi_batch_size": 1000
            "max_get_multi_concurrency": 900
            "max_idle_connections": 1000
            "max_item_size": "1MiB"
            "timeout": "2s"
          "type": "memcached"
        - |-
          --store.caching-bucket.config="blocks_iter_ttl": "5m"
          "chunk_object_attrs_ttl": "24h"
          "chunk_subrange_size": 16000
          "chunk_subrange_ttl": "24h"
          "config":
            "addresses":
            - "dnssrv+_client._tcp.observatorium-xyz-thanos-store-memcached.observatorium.svc"
            "dns_provider_update_interval": "10s"
            "max_async_buffer_size": 100000
            "max_async_concurrency": 100
            "max_get_multi_batch_size": 1000
            "max_get_multi_concurrency": 900
            "max_idle_connections": 1000
            "max_item_size": "1MiB"
            "timeout": "2s"
          "max_chunks_get_range_requests": 3
          "metafile_content_ttl": "24h"
          "metafile_doesnt_exist_ttl": "15m"
          "metafile_exists_ttl": "2h"
          "metafile_max_size": "1MiB"
          "type": "memcached"
        - --ignore-deletion-marks-delay=24h
        - |
          --selector.relabel-config=
            - action: hashmod
              source_labels: ["__block_id"]
              target_label: shard
              modulus: 1
            - action: keep
              source_labels: ["shard"]
              regex: 0
        env:
        - name: OBJSTORE_CONFIG
          valueFrom:
            secretKeyRef:
              key: thanos.yaml
              name: thanos-objectstorage
        image: quay.io/thanos/thanos:master-2020-08-12-70f89d83
        livenessProbe:
          failureThreshold: 8
          httpGet:
            path: /-/healthy
            port: 10902
            scheme: HTTP
          periodSeconds: 30
        name: thanos-store
        ports:
        - containerPort: 10901
          name: grpc
        - containerPort: 10902
          name: http
        readinessProbe:
          failureThreshold: 20
          httpGet:
            path: /-/ready
            port: 10902
            scheme: HTTP
          periodSeconds: 5
        terminationMessagePolicy: FallbackToLogsOnError
        volumeMounts:
        - mountPath: /var/thanos/store
          name: data
          readOnly: false
      terminationGracePeriodSeconds: 120
      volumes:
      - emptyDir: {}
        name: data
  volumeClaimTemplates: null
