Skip to content

Commit 3fff51b

Browse files
authored
Merge pull request #66 from projectsyn/extraArgs_compactor
Add possibility to set extrArgs for compactor resource
2 parents 2bd6878 + e894e2b commit 3fff51b

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

component/compactor.libsonnet

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ local inv = kap.inventory();
99
local params = inv.parameters.thanos;
1010

1111
local compactor = thanos.compact(params.commonConfig + params.compactor) {
12+
statefulSet+: {
13+
spec+: {
14+
template+: {
15+
spec+: {
16+
containers: [
17+
if c.name == 'thanos-compact' && 'extraArgs' in params.compactor then
18+
c {
19+
args+: params.compactor.extraArgs,
20+
}
21+
else
22+
c
23+
for c in super.containers
24+
],
25+
},
26+
},
27+
},
28+
},
1229
alerts: alerts.PrometheusRuleFromMixin('thanos-compactor-alerts', [ 'thanos-compact.rules', 'thanos-compact' ], params.compactor_alerts),
1330
custom_alerts: alerts.PrometheusRuleForCustom('thanos-compactor-custom-alerts', 'thanos-compactor-custom.rules', params.compactor_alerts.custom),
1431
};

docs/modules/ROOT/pages/references/parameters.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,14 @@ default:: `false`
361361
If the Compactor component should be deployed.
362362
It will require an `objectStorageConfig` if enabled.
363363

364+
=== `extraArgs`
365+
366+
[horizontal]
367+
type:: array
368+
default:: `null`
369+
370+
If the Compactor component should receive additional arguments. Those extraArgs are extending the command line arguments of the Compactor container.
371+
364372
== `compactor_alerts.enabled`
365373

366374
[horizontal]

tests/all-in-one.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ parameters:
2626
enabled: true
2727
compactor:
2828
enabled: true
29+
extraArgs:
30+
- "--wait-interval=24h"
31+
- "--compact.cleanup-interval=24h"
32+
- "--block-viever.global.sync-block-interval=30m"
33+
- "--compact.progress-interval=0s"
34+
- "--web.disable"
35+
- "--consistency-delay=30m"
2936
compactor_alerts:
3037
patches:
3138
"*":

tests/golden/all-in-one/thanos/thanos/compactor/statefulSet.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ spec:
5959
- --downsample.concurrency=1
6060
- --deduplication.replica-label=prometheus_replica
6161
- --deduplication.replica-label=rule_replica
62+
- --wait-interval=24h
63+
- --compact.cleanup-interval=24h
64+
- --block-viever.global.sync-block-interval=30m
65+
- --compact.progress-interval=0s
66+
- --web.disable
67+
- --consistency-delay=30m
6268
env:
6369
- name: OBJSTORE_CONFIG
6470
valueFrom:

0 commit comments

Comments
 (0)