diff --git a/CHANGELOG.md b/CHANGELOG.md index 82825a1..91a938f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet b/jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet index 8d71c4b..df5029b 100644 --- a/jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet @@ -35,6 +35,7 @@ tenantHeader: null, clusterDomain: 'cluster.local', extraEnv: [], + receiveLimitsConfigFile: {}, commonLabels:: { 'app.kubernetes.io/name': 'thanos-receive', diff --git a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet index 94ce934..ba7f75f 100644 --- a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet @@ -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', @@ -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' } } }, @@ -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', @@ -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: {