From 00fe1af48041e136b81b20f179dbb63b1fffc57e Mon Sep 17 00:00:00 2001 From: Kemal Akkoyun Date: Tue, 24 Mar 2020 17:01:58 +0100 Subject: [PATCH] compactor, store gw: Add deduplication replica label flags and delete delay flags (#105) * Add deduplication replica label flags Signed-off-by: Kemal Akkoyun * Add delete delay flags Signed-off-by: Kemal Akkoyun * Update Changelog Signed-off-by: Kemal Akkoyun --- CHANGELOG.md | 2 + .../kube-thanos/kube-thanos-compact.libsonnet | 43 +++++++++++++++++++ .../kube-thanos/kube-thanos-store.libsonnet | 20 +++++++++ 3 files changed, 65 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf29bf9..003377f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ We use *breaking* word for marking changes that are not backward compatible (rel - [#99](https://github.com/thanos-io/kube-thanos/pull/99) receive: Adapt receive local endpoint to gRPC based endpoint +- [#105](https://github.com/thanos-io/kube-thanos/pull/105) compactor, store: Add deduplication replica label flags and delete delay labels + ### Fixed - diff --git a/jsonnet/kube-thanos/kube-thanos-compact.libsonnet b/jsonnet/kube-thanos/kube-thanos-compact.libsonnet index 8aa5e1ea..f258c664 100644 --- a/jsonnet/kube-thanos/kube-thanos-compact.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-compact.libsonnet @@ -188,6 +188,49 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; }, }, + withDeduplication:: { + local tc = self, + + statefulSet+: { + spec+: { + template+: { + spec+: { + containers: [ + if c.name == 'thanos-compact' then c { + args+: [ + '--deduplication.replica-label=' + l + for l in tc.config.deduplicationReplicaLabels + ], + } else c + for c in super.containers + ], + }, + }, + }, + }, + }, + + withDeleteDelay:: { + local tc = self, + + statefulSet+: { + spec+: { + template+: { + spec+: { + containers: [ + if c.name == 'thanos-compact' then c { + args+: [ + '--delete-delay=' + tc.config.deleteDelay, + ], + } else c + for c in super.containers + ], + }, + }, + }, + }, + }, + withResources:: { local tc = self, config+:: { diff --git a/jsonnet/kube-thanos/kube-thanos-store.libsonnet b/jsonnet/kube-thanos/kube-thanos-store.libsonnet index ecc05e82..89192b29 100644 --- a/jsonnet/kube-thanos/kube-thanos-store.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-store.libsonnet @@ -101,6 +101,26 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; }, }, + withIgnoreDeletionMarksDelay:: { + local ts = self, + statefulSet+: { + spec+: { + template+: { + spec+: { + containers: [ + if c.name == 'thanos-store' then c { + args+: [ + '--ignore-deletion-marks-delay=' + ts.config.ignoreDeletionMarksDelay, + ], + } else c + for c in super.containers + ], + }, + }, + }, + }, + }, + withServiceMonitor:: { local ts = self, serviceMonitor: {