Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra env vars to all components deployed with kube-thanos #251

Merged
merged 4 commits into from
Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel

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

### Fixed

Expand Down
5 changes: 4 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-bucket-replicate.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local defaults = {
maxTime: '',
compactionLevels: [],
resolutions: [],
extraEnv: [],

commonLabels:: {
'app.kubernetes.io/name': 'thanos-bucket-replicate',
Expand Down Expand Up @@ -138,7 +139,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tbr.config.extraEnv) > 0 then tbr.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tbr.config.ports[name] }
for name in std.objectFields(tbr.config.ports)
Expand Down
5 changes: 4 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-bucket.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local defaults = {
http: 10902,
},
tracing: {},
extraEnv: [],

commonLabels:: {
'app.kubernetes.io/name': 'thanos-bucket',
Expand Down Expand Up @@ -118,7 +119,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tb.config.extraEnv) > 0 then tb.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tb.config.ports[name] }
for name in std.objectFields(tb.config.ports)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
http: 10902,
},
tracing: {},
extraEnv: [],

commonLabels:: {
'app.kubernetes.io/name': 'thanos-compact',
Expand Down
4 changes: 3 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-compact.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tc.config.extraEnv) > 0 then tc.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tc.config.ports[name] }
for name in std.objectFields(tc.config.ports)
Expand Down
5 changes: 4 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-query-frontend.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ local defaults = {
http: 9090,
},
tracing: {},
extraEnv: [],

memcachedDefaults+:: {
config+: {
Expand Down Expand Up @@ -179,7 +180,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tqf.config.extraEnv) > 0 then tqf.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tqf.config.ports[name] }
for name in std.objectFields(tqf.config.ports)
Expand Down
5 changes: 4 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-query.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local defaults = {
logLevel: 'info',
logFormat: 'logfmt',
tracing: {},
extraEnv: [],

commonLabels:: {
'app.kubernetes.io/name': 'thanos-query',
Expand Down Expand Up @@ -150,7 +151,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tq.config.extraEnv) > 0 then tq.config.extraEnv else []
),
ports: [
{ name: port.name, containerPort: port.port }
for port in tq.service.spec.ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'receive="true"',
],
tenantLabelName: null,
extraEnv: [],

commonLabels:: {
'app.kubernetes.io/name': 'thanos-receive',
Expand Down
4 changes: 3 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-receive-router.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tr.config.extraEnv) > 0 then tr.config.extraEnv else []
),
ports: [{ name: name, containerPort: tr.config.ports[name] } for name in std.objectFields(tr.config.ports)],
volumeMounts: [{ name: 'hashring-config', mountPath: '/var/lib/thanos-receive' }],
livenessProbe: { failureThreshold: 8, periodSeconds: 30, httpGet: {
Expand Down
2 changes: 2 additions & 0 deletions jsonnet/kube-thanos/kube-thanos-receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ function(params) {
name: tr.config.objectStorageConfig.name,
} },
}] else []
) + (
if std.length(tr.config.extraEnv) > 0 then tr.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tr.config.ports[name] }
Expand Down
5 changes: 4 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-rule.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ local defaults = {
reloader: 9533,
},
tracing: {},
extraEnv: [],

commonLabels:: {
'app.kubernetes.io/name': 'thanos-rule',
Expand Down Expand Up @@ -146,7 +147,9 @@ function(params) {
},
},
},
],
] + (
if std.length(tr.config.extraEnv) > 0 then tr.config.extraEnv else []
),
ports: [
{ name: name, containerPort: tr.config.ports[name] }
for name in std.objectFields(tr.config.ports)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
tracing: {},
minTime: '',
maxTime: '',
extraEnv: [],

memcachedDefaults+:: {
config+: {
Expand Down
17 changes: 12 additions & 5 deletions jsonnet/kube-thanos/kube-thanos-store.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ function(params) {
] else []
),
env: [
{ name: 'OBJSTORE_CONFIG', valueFrom: { secretKeyRef: {
key: ts.config.objectStorageConfig.key,
name: ts.config.objectStorageConfig.name,
} } },
{
name: 'OBJSTORE_CONFIG',
valueFrom: {
secretKeyRef: {
key: ts.config.objectStorageConfig.key,
name: ts.config.objectStorageConfig.name,
},
},
},
{
// Inject the host IP to make configuring tracing convenient.
name: 'HOST_IP_ADDRESS',
Expand All @@ -112,7 +117,9 @@ function(params) {
},
},
},
],
] + (
if std.length(ts.config.extraEnv) > 0 then ts.config.extraEnv else []
),
ports: [
{ name: name, containerPort: ts.config.ports[name] }
for name in std.objectFields(ts.config.ports)
Expand Down