From 216275a7e4eb27fb063da2bfdc36064dad8456de Mon Sep 17 00:00:00 2001 From: Michael Burt Date: Tue, 19 Jul 2022 13:21:08 -0600 Subject: [PATCH] remove replicaLabel assertion from kube-thanos-receive, updates examples & docs Signed-off-by: Michael Burt --- README.md | 7 ++++--- all.jsonnet | 2 +- example.jsonnet | 7 ++++--- jsonnet/kube-thanos/kube-thanos-receive.libsonnet | 1 - 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6d42e8e3..63e26f22 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,10 @@ local commonConfig = { }; local i = t.receiveIngestor(commonConfig.config { + labels: [ + 'receive_replica="$(POD_NAME)"', + ], replicas: 1, - replicaLabels: ['receive_replica'], replicationFactor: 1, // Disable shipping to object storage for the purposes of this example objectStorageConfig: null, @@ -108,7 +110,6 @@ local i = t.receiveIngestor(commonConfig.config { local r = t.receiveRouter(commonConfig.config { replicas: 1, - replicaLabels: ['receive_replica'], replicationFactor: 1, // Disable shipping to object storage for the purposes of this example objectStorageConfig: null, @@ -122,7 +123,7 @@ local s = t.store(commonConfig.config { local q = t.query(commonConfig.config { replicas: 1, - replicaLabels: ['prometheus_replica', 'rule_replica'], + replicaLabels: ['prometheus_replica', 'receive_replica', 'rule_replica'], serviceMonitor: true, stores: [s.storeEndpoint] + i.storeEndpoints, }); diff --git a/all.jsonnet b/all.jsonnet index a3cfd232..ceeebaee 100644 --- a/all.jsonnet +++ b/all.jsonnet @@ -8,7 +8,7 @@ local commonConfig = { namespace: 'thanos', version: 'v0.26.0', image: 'quay.io/thanos/thanos:' + cfg.version, - replicaLabels: ['prometheus_replica', 'rule_replica'], + replicaLabels: ['prometheus_replica', 'receive_replica', 'rule_replica'], objectStorageConfig: { name: 'thanos-objectstorage', key: 'thanos.yaml', diff --git a/example.jsonnet b/example.jsonnet index 95dcebdb..a40eba67 100644 --- a/example.jsonnet +++ b/example.jsonnet @@ -28,8 +28,10 @@ local commonConfig = { }; local i = t.receiveIngestor(commonConfig.config { + labels: [ + 'receive_replica="$(POD_NAME)"', + ], replicas: 1, - replicaLabels: ['receive_replica'], replicationFactor: 1, // Disable shipping to object storage for the purposes of this example objectStorageConfig: null, @@ -37,7 +39,6 @@ local i = t.receiveIngestor(commonConfig.config { local r = t.receiveRouter(commonConfig.config { replicas: 1, - replicaLabels: ['receive_replica'], replicationFactor: 1, // Disable shipping to object storage for the purposes of this example objectStorageConfig: null, @@ -51,7 +52,7 @@ local s = t.store(commonConfig.config { local q = t.query(commonConfig.config { replicas: 1, - replicaLabels: ['prometheus_replica', 'rule_replica'], + replicaLabels: ['prometheus_replica', 'receive_replica', 'rule_replica'], serviceMonitor: true, stores: [s.storeEndpoint] + i.storeEndpoints, }); diff --git a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet index 0848eab3..374e63f1 100644 --- a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet @@ -7,7 +7,6 @@ function(params) { config:: defaults + params, // Safety checks for combined config of defaults and params assert std.isNumber(tr.config.replicas) && tr.config.replicas >= 0 : 'thanos receive replicas has to be number >= 0', - assert std.isArray(tr.config.replicaLabels), assert std.isObject(tr.config.resources), assert std.isBoolean(tr.config.serviceMonitor), assert std.isObject(tr.config.volumeClaimTemplate),