#apiVersion: apps/v1
#kind: StatefulSet
#metadata:
#  labels:
#    app.kubernetes.io/component: database-compactor
#    app.kubernetes.io/instance: thanos-compact
#    app.kubernetes.io/name: thanos-compact
#    app.kubernetes.io/version: v0.17.0
#  name: thanos-compact
#  namespace: monitoring
#spec:
#  replicas: 1
#  selector:
#    matchLabels:
#      app.kubernetes.io/component: database-compactor
#      app.kubernetes.io/instance: thanos-compact
#      app.kubernetes.io/name: thanos-compact
#  serviceName: thanos-compact
#  template:
#    metadata:
#      labels:
#        app.kubernetes.io/component: database-compactor
#        app.kubernetes.io/instance: thanos-compact
#        app.kubernetes.io/name: thanos-compact
#        app.kubernetes.io/version: v0.17.0
#    spec:
#      serviceAccountName: "thanos"
#      containers:
#      - args:
#        - compact
#        - --wait
#        - --objstore.config=$(OBJSTORE_CONFIG)
#        - --data-dir=/var/thanos/compact
#        - --debug.accept-malformed-index
#        # see detail: https://github.com/thanos-io/thanos/blob/master/docs/components/compact.md#downsampling-resolution-and-retention
#        - --retention.resolution-raw=90d
#        - --retention.resolution-5m=180d
#        - --retention.resolution-1h=360d
#        - --delete-delay=0s
#        - --debug.max-compaction-level=3
#        env:
#        - name: OBJSTORE_CONFIG
#          valueFrom:
#            secretKeyRef:
#              key: thanos.yaml
#              name: thanos-objectstorage
#        image: gcr.io/pingcap-public/thanos/thanos:v0.17.0
#        resources:
#          requests:
#            cpu: 700m
#            memory: 1024Mi
#          limits:
#            cpu: 700m
#            memory: 1024Mi
#        livenessProbe:
#          failureThreshold: 4
#          httpGet:
#            path: /-/healthy
#            port: 10902
#            scheme: HTTP
#          periodSeconds: 30
#        name: thanos-compact
#        ports:
#        - containerPort: 10902
#          name: http
#        readinessProbe:
#          failureThreshold: 20
#          httpGet:
#            path: /-/ready
#            port: 10902
#            scheme: HTTP
#          periodSeconds: 5
#        terminationMessagePolicy: FallbackToLogsOnError
#        volumeMounts:
#        - mountPath: /var/thanos/compact
#          name: data
#          readOnly: false
#      terminationGracePeriodSeconds: 120
#      volumes: []
#  volumeClaimTemplates:
#  - metadata:
#      labels:
#        app.kubernetes.io/component: database-compactor
#        app.kubernetes.io/instance: thanos-compact
#        app.kubernetes.io/name: thanos-compact
#      name: data
#    spec:
#      accessModes:
#      - ReadWriteOnce
#      resources:
#        requests:
#          storage: 10Gi
#      storageClassName: prometheus.cloud-fast
