From f1d900f4092198b199c02411f4ba3baf527287ab Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Mon, 4 Dec 2023 12:28:52 +0000 Subject: [PATCH] feat(thanos): Added support for disabling compact dedupe (#837) Signed-off-by: Steve Hipwell --- charts/thanos/CHANGELOG.md | 9 +++++++++ charts/thanos/ci/ci-values.yaml | 3 +++ charts/thanos/ci/kubeconform.yaml | 4 +++- charts/thanos/templates/compact/statefulset.yaml | 6 +++++- charts/thanos/values.yaml | 4 ++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/charts/thanos/CHANGELOG.md b/charts/thanos/CHANGELOG.md index 53e546ec..1bc2d710 100644 --- a/charts/thanos/CHANGELOG.md +++ b/charts/thanos/CHANGELOG.md @@ -20,11 +20,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +### Added + +- Added `compact.deduplication.enabled` value to disable compact deduplication. +- Added `compact.deduplication.func` value to set the compact deduplication function. + ### Changed - Changed the default `configmap-reload` image variant to `cgr.dev/chainguard/configmap-reload:latest`. - Added support for specifying custom Kubernetes cluster domain +### Deprecated + +- Deprecated the `compact.replicaDeduplication` value in favour of setting `compact.deduplication.func=penalty`. + ## [v1.14.5] - 2023-10-20 ### Changed diff --git a/charts/thanos/ci/ci-values.yaml b/charts/thanos/ci/ci-values.yaml index e36ea76b..e2dea0f1 100644 --- a/charts/thanos/ci/ci-values.yaml +++ b/charts/thanos/ci/ci-values.yaml @@ -1,6 +1,9 @@ compact: enabled: false + deduplication: + enabled: false + queryFrontend: enabled: true diff --git a/charts/thanos/ci/kubeconform.yaml b/charts/thanos/ci/kubeconform.yaml index cd25babb..7e65f866 100644 --- a/charts/thanos/ci/kubeconform.yaml +++ b/charts/thanos/ci/kubeconform.yaml @@ -13,7 +13,9 @@ compact: persistence: enabled: true - replicaDeduplication: true + deduplication: + enabled: true + func: penalty nodeSelector: kubernetes.io/os: linux diff --git a/charts/thanos/templates/compact/statefulset.yaml b/charts/thanos/templates/compact/statefulset.yaml index d9112dda..9de2695d 100644 --- a/charts/thanos/templates/compact/statefulset.yaml +++ b/charts/thanos/templates/compact/statefulset.yaml @@ -76,12 +76,16 @@ spec: - --http-address=0.0.0.0:10902 - --data-dir=/var/thanos/compact - --objstore.config-file=/etc/thanos/objstore.yaml + {{- if .Values.compact.deduplication.enabled }} {{- range (concat .Values.additionalReplicaLabels (ternary (list "rule_replica") (list) .Values.rule.enabled ) (ternary (list "receive_replica") (list) .Values.receive.enabled )) | uniq }} - --deduplication.replica-label={{ . }} {{- end }} - {{- if .Values.compact.replicaDeduplication }} + {{- if .Values.compact.deduplication.func }} + - --deduplication.func={{ .Values.compact.deduplication.func }} + {{- else if .Values.compact.replicaDeduplication }} - --deduplication.func=penalty {{- end }} + {{- end }} {{- with .Values.compact.extraArgs }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/thanos/values.yaml b/charts/thanos/values.yaml index 0d147621..c42ec84d 100644 --- a/charts/thanos/values.yaml +++ b/charts/thanos/values.yaml @@ -70,6 +70,10 @@ compact: extraEnv: [] + deduplication: + enabled: true + func: + replicaDeduplication: false extraArgs: []