mirror of
https://github.com/thanos-io/kube-thanos.git
synced 2026-05-06 04:26:12 +02:00
Hopefully this will scope the component's features better and going forward will make it more obvious what each component supports (by looking at it's default at the top, to check what can be passed to it), the component will even do some safety checks (using assert) on the merged configuration it'll use and give back some Kubernetes objects. If there are some limitations that, after discussing the component shouldn't support, everybody is still able to merge additional features on top of the generated objects. Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
41 lines
1.1 KiB
Jsonnet
41 lines
1.1 KiB
Jsonnet
// Usually this should be an absolute import paths.
|
|
// In this instance, however, we use a local symlink cause this is within the same repository.
|
|
local thanos = import 'kube-thanos/thanos.libsonnet';
|
|
|
|
// This is a config shared across components.
|
|
// Before passing the params to the component this config is merged with the component's config.
|
|
local config = {
|
|
namespace: 'thanos',
|
|
version: 'v0.15.0',
|
|
image: 'quay.io/thanos/thanos:' + self.version,
|
|
objectStorageConfig: {
|
|
name: 'thanos-objectstorage',
|
|
key: 'thanos.yaml',
|
|
},
|
|
volumeClaimTemplate: {
|
|
spec: {
|
|
accessModes: ['ReadWriteOnce'],
|
|
resources: {
|
|
requests: {
|
|
storage: '10Gi',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
local store = thanos.store(config {
|
|
name: 'thanos-store',
|
|
replicas: 1,
|
|
serviceMonitor: true,
|
|
});
|
|
|
|
local query = thanos.query(config {
|
|
replicas: 1,
|
|
replicaLabels: ['prometheus_replica', 'rule_replica'],
|
|
serviceMonitor: true,
|
|
});
|
|
|
|
{ ['thanos-store-' + name]: store[name] for name in std.objectFields(store) } +
|
|
{ ['thanos-query-' + name]: query[name] for name in std.objectFields(query) }
|