Skip to content

Commit

Permalink
simplify to use exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
clyang82 committed Mar 16, 2021
1 parent 9cc733e commit 4c513c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions example/manifests/observatorium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ spec:
- hashring: default
tenants: []
loki:
image: docker.io/grafana/loki:2.1.0
image: docker.io/grafana/loki:2.0.0
replicas:
compactor: 1
distributor: 1
ingester: 1
querier: 1
query_frontend: 1
version: 2.1.0
version: 2.0.0
volumeClaimTemplate:
spec:
accessModes:
Expand Down
26 changes: 11 additions & 15 deletions jsonnet/obs-operator.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ local operatorObs = obs {
objectStorageConfig: cr.spec.objectStorageConfig.thanos,
} + if std.objectHas(cr.spec, 'store') then cr.spec.store else {},

storeCache+:: {
storeCache+:: (if std.objectHas(cr.spec, 'store') && std.objectHas(cr.spec.store, 'cache') then cr.spec.store.cache else {}) + {
memoryLimitMb: if std.objectHas(cr.spec.store, 'cache') && std.objectHas(cr.spec.store.cache, 'memoryLimitMb') then cr.spec.store.cache.memoryLimitMb else obs.thanos.storeCache.config.memoryLimitMb,
} + if std.objectHas(cr.spec, 'store') && std.objectHas(cr.spec.store, 'cache') then cr.spec.store.cache else {},
resources+: (
if std.objectHas(cr.spec.store.cache, 'resources') then {
memcached: cr.spec.store.cache.resources
} else {}
) + (
if std.objectHas(cr.spec.store.cache, 'exporterResources') then {
exporter: cr.spec.store.cache.exporterResources
} else {}
),
},

query+:: if std.objectHas(cr.spec, 'query') then cr.spec.query else {},

Expand Down Expand Up @@ -104,19 +113,6 @@ local operatorObs = obs {
},
},
} else {}
) + (
if (std.objectHas(cr.spec.store.cache, 'exporterResources') && v.kind == 'StatefulSet' && v.metadata.name == obs.config.name + '-thanos-store-memcached') then {
template+: {
spec+:{
containers: [
if c.name == 'exporter' then c {
resources: cr.spec.store.cache.exporterResources,
} else c
for c in super.containers
],
},
},
} else {}
) + (
if (std.objectHas(cr.spec.rule, 'reloaderResources') && (v.kind == 'StatefulSet') && v.metadata.name == obs.config.name + '-thanos-rule') then {
template+: {
Expand Down

0 comments on commit 4c513c8

Please sign in to comment.