Skip to content

Commit 29f0836

Browse files
committed
add extraEnv config option to all components in kube-thanos
Signed-off-by: Michal Wasilewski <[email protected]>
1 parent 00a6a01 commit 29f0836

12 files changed

+52
-8
lines changed

jsonnet/kube-thanos/kube-thanos-bucket-replicate.libsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ local defaults = {
2020
maxTime: '',
2121
compactionLevels: [],
2222
resolutions: [],
23+
extraEnv: [],
2324

2425
commonLabels:: {
2526
'app.kubernetes.io/name': 'thanos-bucket-replicate',
@@ -138,7 +139,11 @@ function(params) {
138139
},
139140
},
140141
},
141-
],
142+
] + (
143+
if std.length(tbr.config.extraEnv) > 0 then [
144+
tbr.config.extraEnv,
145+
] else []
146+
),
142147
ports: [
143148
{ name: name, containerPort: tbr.config.ports[name] }
144149
for name in std.objectFields(tbr.config.ports)

jsonnet/kube-thanos/kube-thanos-bucket.libsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ local defaults = {
1515
http: 10902,
1616
},
1717
tracing: {},
18+
extraEnv: [],
1819

1920
commonLabels:: {
2021
'app.kubernetes.io/name': 'thanos-bucket',
@@ -118,7 +119,11 @@ function(params) {
118119
},
119120
},
120121
},
121-
],
122+
] + (
123+
if std.length(tb.config.extraEnv) > 0 then [
124+
tb.config.extraEnv,
125+
] else []
126+
),
122127
ports: [
123128
{ name: name, containerPort: tb.config.ports[name] }
124129
for name in std.objectFields(tb.config.ports)

jsonnet/kube-thanos/kube-thanos-compact-default-params.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
http: 10902,
2424
},
2525
tracing: {},
26+
extraEnv: [],
2627

2728
commonLabels:: {
2829
'app.kubernetes.io/name': 'thanos-compact',

jsonnet/kube-thanos/kube-thanos-compact.libsonnet

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ function(params) {
9393
},
9494
},
9595
},
96-
],
96+
] + (
97+
if std.length(tc.config.extraEnv) > 0 then [
98+
tc.config.extraEnv,
99+
] else []
100+
),
97101
ports: [
98102
{ name: name, containerPort: tc.config.ports[name] }
99103
for name in std.objectFields(tc.config.ports)

jsonnet/kube-thanos/kube-thanos-query-frontend.libsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ local defaults = {
2929
http: 9090,
3030
},
3131
tracing: {},
32+
extraEnv: [],
3233

3334
memcachedDefaults+:: {
3435
config+: {
@@ -179,7 +180,11 @@ function(params) {
179180
},
180181
},
181182
},
182-
],
183+
] + (
184+
if std.length(tqf.config.extraEnv) > 0 then [
185+
tqf.config.extraEnv,
186+
] else []
187+
),
183188
ports: [
184189
{ name: name, containerPort: tqf.config.ports[name] }
185190
for name in std.objectFields(tqf.config.ports)

jsonnet/kube-thanos/kube-thanos-query.libsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ local defaults = {
2424
logLevel: 'info',
2525
logFormat: 'logfmt',
2626
tracing: {},
27+
extraEnv: [],
2728

2829
commonLabels:: {
2930
'app.kubernetes.io/name': 'thanos-query',
@@ -150,7 +151,11 @@ function(params) {
150151
},
151152
},
152153
},
153-
],
154+
] + (
155+
if std.length(tq.config.extraEnv) > 0 then [
156+
tq.config.extraEnv,
157+
] else []
158+
),
154159
ports: [
155160
{ name: port.name, containerPort: port.port }
156161
for port in tq.service.spec.ports

jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
'receive="true"',
3131
],
3232
tenantLabelName: null,
33+
extraEnv: [],
3334

3435
commonLabels:: {
3536
'app.kubernetes.io/name': 'thanos-receive',

jsonnet/kube-thanos/kube-thanos-receive-router.libsonnet

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ function(params) {
111111
},
112112
},
113113
},
114-
],
114+
] + (
115+
if std.length(tr.config.extraEnv) > 0 then [
116+
tr.config.extraEnv,
117+
] else []
118+
),
115119
ports: [{ name: name, containerPort: tr.config.ports[name] } for name in std.objectFields(tr.config.ports)],
116120
volumeMounts: [{ name: 'hashring-config', mountPath: '/var/lib/thanos-receive' }],
117121
livenessProbe: { failureThreshold: 8, periodSeconds: 30, httpGet: {

jsonnet/kube-thanos/kube-thanos-receive.libsonnet

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ function(params) {
113113
name: tr.config.objectStorageConfig.name,
114114
} },
115115
}] else []
116+
) + (
117+
if std.length(tr.config.extraEnv) > 0 then [
118+
tr.config.extraEnv,
119+
] else []
116120
),
117121
ports: [
118122
{ name: name, containerPort: tr.config.ports[name] }

jsonnet/kube-thanos/kube-thanos-rule.libsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ local defaults = {
2626
reloader: 9533,
2727
},
2828
tracing: {},
29+
extraEnv: [],
2930

3031
commonLabels:: {
3132
'app.kubernetes.io/name': 'thanos-rule',
@@ -146,7 +147,11 @@ function(params) {
146147
},
147148
},
148149
},
149-
],
150+
] + (
151+
if std.length(tr.config.extraEnv) > 0 then [
152+
tr.config.extraEnv,
153+
] else []
154+
),
150155
ports: [
151156
{ name: name, containerPort: tr.config.ports[name] }
152157
for name in std.objectFields(tr.config.ports)

0 commit comments

Comments
 (0)