Skip to content

Commit

Permalink
(compact|store)-shards/receive-hashrings: Hide non-resource fields
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
  • Loading branch information
maxbrunet committed Sep 13, 2021
1 parent cfd8d78 commit fb056aa
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel

### Changed

-
- [#234](https://github.com/thanos-io/kube-thanos/pull/234) (compact|store)-shards/receive-hashrings: Hide non-resource fields (`hashrings`/`shards`)

### Added

Expand Down
12 changes: 5 additions & 7 deletions all.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ local finalQ = t.query(q.config {
{ ['thanos-bucket-replicate-' + name]: br[name] for name in std.objectFields(br) if br[name] != null } +
{ ['thanos-compact-' + name]: c[name] for name in std.objectFields(c) if c[name] != null } +
{
['compact-' + shard + '-' + name]: cs.shards[shard][name]
['thanos-compact-' + shard + '-' + name]: cs.shards[shard][name]
for shard in std.objectFields(cs.shards)
for name in std.objectFields(cs.shards[shard])
if cs.shards[shard][name] != null
Expand All @@ -248,13 +248,11 @@ local finalQ = t.query(q.config {
if rcvs.hashrings[hashring][name] != null
} +
{
['store-' + shard + '-' + name]: strs.shards[shard][name]
['thanos-store-' + shard + '-' + name]: strs.shards[shard][name]
for shard in std.objectFields(strs.shards)
for name in std.objectFields(strs.shards[shard])
if strs.shards[shard][name] != null
} +
{
'compact-shards-serviceMonitor': cs.serviceMonitor,
'store-shards-serviceMonitor': strs.serviceMonitor,
'receive-hashrings-serviceMonitor': rcvs.serviceMonitor,
}
{ ['thanos-compact-shards-' + name]: cs[name] for name in std.objectFields(cs) if cs[name] != null } +
{ ['thanos-receive-hashrings-' + name]: rcvs[name] for name in std.objectFields(rcvs) if rcvs[name] != null } +
{ ['thanos-store-shards-' + name]: strs[name] for name in std.objectFields(strs) if strs[name] != null }
10 changes: 10 additions & 0 deletions examples/all/manifests/thanos-compact-shards-serviceAccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/component: database-compactor
app.kubernetes.io/instance: thanos-compact
app.kubernetes.io/name: thanos-compact
app.kubernetes.io/version: v0.22.0
name: thanos-compact
namespace: thanos
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/component: database-write-hashring
app.kubernetes.io/instance: thanos-receive
app.kubernetes.io/name: thanos-receive
app.kubernetes.io/version: v0.22.0
name: thanos-receive
namespace: thanos
10 changes: 10 additions & 0 deletions examples/all/manifests/thanos-store-shards-serviceAccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/component: object-store-gateway
app.kubernetes.io/instance: thanos-store
app.kubernetes.io/name: thanos-store
app.kubernetes.io/version: v0.22.0
name: thanos-store
namespace: thanos
2 changes: 1 addition & 1 deletion jsonnet/kube-thanos/kube-thanos-compact-shards.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(params)
},
},

shards: {
shards:: {
['shard' + i]: compact(config {
name+: '-%d' % i,
commonLabels+:: { 'compact.thanos.io/shard': 'shard-' + i },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function(params)
labels: config.commonLabels,
},
},
hashrings: {
hashrings:: {
[h.hashring]: receive(config {
name+: '-' + h.hashring,
commonLabels+:: {
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/kube-thanos/kube-thanos-store-shards.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function(params)
},
},

shards: {
shards:: {
['shard' + i]: store(config {
name+: '-%d' % i,
commonLabels+:: { 'store.thanos.io/shard': 'shard-' + i },
Expand Down

0 comments on commit fb056aa

Please sign in to comment.