apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/name: thanos-compactor
  name: thanos-compactor
  namespace: observatorium
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: thanos-compactor
  serviceName: thanos-compactor
  template:
    metadata:
      labels:
        app.kubernetes.io/name: thanos-compactor
    spec:
      containers:
      - args:
        - compact
        - --wait
        - --retention.resolution-raw=14d
        - --downsampling.disable
        - --retention.resolution-5m=1s
        - --retention.resolution-1h=1s
        - --objstore.config=$(OBJSTORE_CONFIG)
        - --data-dir=/var/thanos/compactor
        - --debug.accept-malformed-index
        - |
          --tracing.config=
            type: JAEGER
            config:
              service_name: thanos-compactor
              sampler_type: ratelimiting
              sampler_param: 2
        env:
        - name: OBJSTORE_CONFIG
          valueFrom:
            secretKeyRef:
              key: thanos.yaml
              name: thanos-objectstorage
        image: quay.io/thanos/thanos:v0.8.1
        name: thanos-compactor
        ports:
        - containerPort: 10902
          name: http
        readinessProbe:
          httpGet:
            path: /-/ready
            port: 10902
            scheme: HTTP
        resources:
          limits:
            cpu: 500m
            memory: 2Gi
          requests:
            cpu: 100m
            memory: 1Gi
        volumeMounts:
        - mountPath: /var/thanos/compactor
          name: thanos-compactor-data
          readOnly: false
      - args:
        - --reporter.grpc.host-port=dns:///jaeger-collector-headless.$(NAMESPACE).svc:14250
        - --reporter.type=grpc
        - --jaeger.tags=pod.namespace=$(NAMESPACE),pod.name=$(POD)
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        image: jaegertracing/jaeger-agent:1.14.0
        name: jaeger-agent
        ports:
        - containerPort: 6831
          name: jaeger-thrift
        - containerPort: 5778
          name: configs
        resources:
          limits:
            cpu: 128m
            memory: 64Mi
          requests:
            cpu: 32m
            memory: 16Mi
      volumes:
      - emptyDir: {}
        name: thanos-compactor-data
