From 3642796ab247e3d5f435125eece4a5f34bda1ae3 Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Mon, 3 Feb 2025 16:09:32 +0800 Subject: [PATCH] prometheus: add thanos compact --- monitoring/prometheus/deployment-compact.yaml | 44 +++++++++++++++++++ monitoring/prometheus/kustomization.yaml | 1 + 2 files changed, 45 insertions(+) create mode 100644 monitoring/prometheus/deployment-compact.yaml diff --git a/monitoring/prometheus/deployment-compact.yaml b/monitoring/prometheus/deployment-compact.yaml new file mode 100644 index 0000000..295deb2 --- /dev/null +++ b/monitoring/prometheus/deployment-compact.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: thanos-compact +spec: + replicas: 1 + selector: + matchLabels: + component: compact + template: + metadata: + annotations: + prometheus.xdavidwu.link/instance: main + labels: + metrics: metrics + component: compact + spec: + containers: + - name: compact + image: quay.io/thanos/thanos:THANOS_VERSION + args: + - compact + - --data-dir=/tmp + - --objstore.config-file=/etc/thanos/objstore.yml + - --wait + - --wait-interval=1h + - --compact.cleanup-interval=6h + - --block-viewer.global.sync-block-interval=1h + - --retention.resolution-5m=120d + - --retention.resolution-raw=30d + ports: + - name: metrics + containerPort: 10902 + readinessProbe: + httpGet: + port: metrics + path: /-/ready + volumeMounts: + - name: thanos + mountPath: /etc/thanos + volumes: + - name: thanos + secret: + secretName: thanos diff --git a/monitoring/prometheus/kustomization.yaml b/monitoring/prometheus/kustomization.yaml index 475d70e..bc24793 100644 --- a/monitoring/prometheus/kustomization.yaml +++ b/monitoring/prometheus/kustomization.yaml @@ -19,6 +19,7 @@ resources: - service-query.yaml - deployment-query-frontend.yaml - service-query-frontend.yaml + - deployment-compact.yaml - configmap.yaml - serviceaccount.yaml - clusterrole.yaml -- 2.45.2