Skip to content

Commit

Permalink
receive: allow configuration of limits-config-file (#305)
Browse files Browse the repository at this point in the history
* add receive limits config file flag

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

* update changelog

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

* make fmt

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>

---------

Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
  • Loading branch information
thibaultmg committed Jun 1, 2023
1 parent 4ab42ad commit 04c9e46
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#292](https://github.com/thanos-io/kube-thanos/pull/292) Store: allow configuration of series, series sample, and downloaded bytes limits.
- [#299](https://github.com/thanos-io/kube-thanos/pull/299) Query: allow configuration of telemetry.request options
- [#301](https://github.com/thanos-io/kube-thanos/pull/301) Receive: allow configuration of `minReadySeconds` for StatefulSet
- [#305](https://github.com/thanos-io/kube-thanos/pull/305) Receive: allow configuration of limits-config-file

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
tenantHeader: null,
clusterDomain: 'cluster.local',
extraEnv: [],
receiveLimitsConfigFile: {},

commonLabels:: {
'app.kubernetes.io/name': 'thanos-receive',
Expand Down
15 changes: 15 additions & 0 deletions jsonnet/kube-thanos/kube-thanos-receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function(params) {
assert std.isObject(tr.config.volumeClaimTemplate),
assert !std.objectHas(tr.config.volumeClaimTemplate, 'spec') || std.assertEqual(tr.config.volumeClaimTemplate.spec.accessModes, ['ReadWriteOnce']) : 'thanos receive PVC accessMode can only be ReadWriteOnce',
assert std.isNumber(tr.config.minReadySeconds),
assert std.isObject(tr.config.receiveLimitsConfigFile),

service: {
apiVersion: 'v1',
Expand Down Expand Up @@ -100,6 +101,11 @@ function(params) {
{ config+: { service_name: defaults.name } } + tr.config.tracing
),
] else []
) + (
if tr.config.receiveLimitsConfigFile != {} then [
'--receive.limits-config-file=/etc/thanos/config/' + tr.config.receiveLimitsConfigFile.name + '/' + tr.config.receiveLimitsConfigFile.key,
]
else []
),
env: [
{ name: 'NAME', valueFrom: { fieldRef: { fieldPath: 'metadata.name' } } },
Expand Down Expand Up @@ -140,6 +146,10 @@ function(params) {
if tr.config.objectStorageConfig != null && std.objectHas(tr.config.objectStorageConfig, 'tlsSecretName') && std.length(tr.config.objectStorageConfig.tlsSecretName) > 0 then [
{ name: 'tls-secret', mountPath: tr.config.objectStorageConfig.tlsSecretMountPath },
] else []
) + (
if tr.config.receiveLimitsConfigFile != {} then [
{ name: tr.config.receiveLimitsConfigFile.name, mountPath: '/etc/thanos/config/' + tr.config.receiveLimitsConfigFile.name, readOnly: true },
] else []
),
livenessProbe: { failureThreshold: 8, periodSeconds: 30, httpGet: {
scheme: 'HTTP',
Expand Down Expand Up @@ -186,6 +196,11 @@ function(params) {
name: 'tls-secret',
secret: { secretName: tr.config.objectStorageConfig.tlsSecretName },
}] else []
) + (
if tr.config.receiveLimitsConfigFile != {} then [{
name: tr.config.receiveLimitsConfigFile.name,
configMap: { name: tr.config.receiveLimitsConfigFile.name },
}] else []
),
terminationGracePeriodSeconds: 900,
nodeSelector: {
Expand Down

0 comments on commit 04c9e46

Please sign in to comment.