Skip to content

Commit fdba356

Browse files
authored
Merge pull request #251 from mwasilew2/add-extra-env-vars
Add extra env vars to all components deployed with kube-thanos
2 parents 14b05c8 + 536eaa8 commit fdba356

13 files changed

+44
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
2525

2626
- [#237](https://github.com/thanos-io/kube-thanos/pull/237) Add new bucket replicate component.
2727
- [#245](https://github.com/thanos-io/kube-thanos/pull/245) Support scraping config reloader sidecar for ruler.
28+
- [#251](https://github.com/thanos-io/kube-thanos/pull/251) Add support for extraEnv (custom environment variables) to all components.
2829

2930
### Fixed
3031

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

Lines changed: 4 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,9 @@ function(params) {
138139
},
139140
},
140141
},
141-
],
142+
] + (
143+
if std.length(tbr.config.extraEnv) > 0 then tbr.config.extraEnv else []
144+
),
142145
ports: [
143146
{ name: name, containerPort: tbr.config.ports[name] }
144147
for name in std.objectFields(tbr.config.ports)

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

Lines changed: 4 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,9 @@ function(params) {
118119
},
119120
},
120121
},
121-
],
122+
] + (
123+
if std.length(tb.config.extraEnv) > 0 then tb.config.extraEnv else []
124+
),
122125
ports: [
123126
{ name: name, containerPort: tb.config.ports[name] }
124127
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ function(params) {
9393
},
9494
},
9595
},
96-
],
96+
] + (
97+
if std.length(tc.config.extraEnv) > 0 then tc.config.extraEnv else []
98+
),
9799
ports: [
98100
{ name: name, containerPort: tc.config.ports[name] }
99101
for name in std.objectFields(tc.config.ports)

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

Lines changed: 4 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,9 @@ function(params) {
179180
},
180181
},
181182
},
182-
],
183+
] + (
184+
if std.length(tqf.config.extraEnv) > 0 then tqf.config.extraEnv else []
185+
),
183186
ports: [
184187
{ name: name, containerPort: tqf.config.ports[name] }
185188
for name in std.objectFields(tqf.config.ports)

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

Lines changed: 4 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,9 @@ function(params) {
150151
},
151152
},
152153
},
153-
],
154+
] + (
155+
if std.length(tq.config.extraEnv) > 0 then tq.config.extraEnv else []
156+
),
154157
ports: [
155158
{ name: port.name, containerPort: port.port }
156159
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ function(params) {
111111
},
112112
},
113113
},
114-
],
114+
] + (
115+
if std.length(tr.config.extraEnv) > 0 then tr.config.extraEnv else []
116+
),
115117
ports: [{ name: name, containerPort: tr.config.ports[name] } for name in std.objectFields(tr.config.ports)],
116118
volumeMounts: [{ name: 'hashring-config', mountPath: '/var/lib/thanos-receive' }],
117119
livenessProbe: { failureThreshold: 8, periodSeconds: 30, httpGet: {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ function(params) {
113113
name: tr.config.objectStorageConfig.name,
114114
} },
115115
}] else []
116+
) + (
117+
if std.length(tr.config.extraEnv) > 0 then tr.config.extraEnv else []
116118
),
117119
ports: [
118120
{ name: name, containerPort: tr.config.ports[name] }

0 commit comments

Comments
 (0)