diff --git a/all.jsonnet b/all.jsonnet index a958884..4be111f 100644 --- a/all.jsonnet +++ b/all.jsonnet @@ -158,8 +158,8 @@ local rcvs = t.receiveHashrings(commonConfig { tenants: [], }, ], - replicas: 1, - replicationFactor: 1, + replicas: 3, + replicationFactor: 2, serviceMonitor: true, hashringConfigMapName: 'hashring', }); @@ -197,13 +197,13 @@ local finalQ = t.query(q.config { ], }); -{ ['thanos-bucket-' + name]: b[name] for name in std.objectFields(b) } + -{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) } + -{ ['thanos-receive-' + name]: re[name] for name in std.objectFields(re) } + -{ ['thanos-rule-' + name]: finalRu[name] for name in std.objectFields(finalRu) } + -{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) } + -{ ['thanos-query-' + name]: finalQ[name] for name in std.objectFields(finalQ) } + -{ ['thanos-query-frontend-' + name]: qf[name] for name in std.objectFields(qf) } + +{ ['thanos-bucket-' + name]: b[name] for name in std.objectFields(b) if b[name] != null} + +{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) if c[name] != null} + +{ ['thanos-receive-' + name]: re[name] for name in std.objectFields(re) if re[name] != null} + +{ ['thanos-rule-' + name]: finalRu[name] for name in std.objectFields(finalRu) if finalRu[name] != null} + +{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) if s[name] != null} + +{ ['thanos-query-' + name]: finalQ[name] for name in std.objectFields(finalQ) if finalQ[name] != null} + +{ ['thanos-query-frontend-' + name]: qf[name] for name in std.objectFields(qf) if qf[name] != null} + { ['thanos-receive-' + hashring + '-' + name]: rcvs.hashrings[hashring][name] for hashring in std.objectFields(rcvs.hashrings) diff --git a/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml b/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml index 7a81123..8734fb2 100644 --- a/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml +++ b/examples/all/manifests/thanos-receive-default-podDisruptionBudget.yaml @@ -4,7 +4,7 @@ metadata: name: thanos-receive-default namespace: thanos spec: - maxUnavailable: 0 + maxUnavailable: 1 selector: matchLabels: app.kubernetes.io/component: database-write-hashring diff --git a/examples/all/manifests/thanos-receive-default-statefulSet.yaml b/examples/all/manifests/thanos-receive-default-statefulSet.yaml index 1075a0c..84a24dd 100644 --- a/examples/all/manifests/thanos-receive-default-statefulSet.yaml +++ b/examples/all/manifests/thanos-receive-default-statefulSet.yaml @@ -11,7 +11,7 @@ metadata: name: thanos-receive-default namespace: thanos spec: - replicas: 1 + replicas: 3 selector: matchLabels: app.kubernetes.io/component: database-write-hashring @@ -69,7 +69,7 @@ spec: - --grpc-address=0.0.0.0:10901 - --http-address=0.0.0.0:10902 - --remote-write.address=0.0.0.0:19291 - - --receive.replication-factor=1 + - --receive.replication-factor=2 - --objstore.config=$(OBJSTORE_CONFIG) - --tsdb.path=/var/thanos/receive - --tsdb.retention=15d diff --git a/examples/all/manifests/thanos-receive-podDisruptionBudget.yaml b/examples/all/manifests/thanos-receive-podDisruptionBudget.yaml deleted file mode 100644 index f9a0619..0000000 --- a/examples/all/manifests/thanos-receive-podDisruptionBudget.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: thanos-receive - namespace: thanos -spec: - maxUnavailable: 0 - selector: - matchLabels: - app.kubernetes.io/component: database-write-hashring - app.kubernetes.io/instance: thanos-receive - app.kubernetes.io/name: thanos-receive diff --git a/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml b/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml index 5154fa9..9e51e1a 100644 --- a/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml +++ b/examples/all/manifests/thanos-receive-region-1-podDisruptionBudget.yaml @@ -4,7 +4,7 @@ metadata: name: thanos-receive-region-1 namespace: thanos spec: - maxUnavailable: 0 + maxUnavailable: 1 selector: matchLabels: app.kubernetes.io/component: database-write-hashring diff --git a/examples/all/manifests/thanos-receive-region-1-statefulSet.yaml b/examples/all/manifests/thanos-receive-region-1-statefulSet.yaml index 44bf803..306b7a0 100644 --- a/examples/all/manifests/thanos-receive-region-1-statefulSet.yaml +++ b/examples/all/manifests/thanos-receive-region-1-statefulSet.yaml @@ -11,7 +11,7 @@ metadata: name: thanos-receive-region-1 namespace: thanos spec: - replicas: 1 + replicas: 3 selector: matchLabels: app.kubernetes.io/component: database-write-hashring @@ -69,7 +69,7 @@ spec: - --grpc-address=0.0.0.0:10901 - --http-address=0.0.0.0:10902 - --remote-write.address=0.0.0.0:19291 - - --receive.replication-factor=1 + - --receive.replication-factor=2 - --objstore.config=$(OBJSTORE_CONFIG) - --tsdb.path=/var/thanos/receive - --tsdb.retention=15d diff --git a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet index 495d03c..8d7cdd0 100644 --- a/jsonnet/kube-thanos/kube-thanos-receive.libsonnet +++ b/jsonnet/kube-thanos/kube-thanos-receive.libsonnet @@ -210,7 +210,7 @@ function(params) { }, }, - podDisruptionBudget: { + podDisruptionBudget: if tr.config.podDisruptionBudgetMaxUnavailable >= 1 then { apiVersion: 'policy/v1beta1', kind: 'PodDisruptionBudget', metadata: { @@ -221,5 +221,5 @@ function(params) { maxUnavailable: tr.config.podDisruptionBudgetMaxUnavailable, selector: { matchLabels: tr.config.podLabelSelector }, }, - }, + } else null, }