forked from thanos-io/kube-thanos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall.jsonnet
131 lines (121 loc) · 3.33 KB
/
all.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local sts = k.apps.v1.statefulSet;
local deployment = k.apps.v1.deployment;
local t = (import 'kube-thanos/thanos.libsonnet');
local commonConfig = {
config+:: {
local cfg = self,
namespace: 'thanos',
version: 'master-2020-05-24-079ad427', // v0.13.0-rc.1 candiate
image: 'quay.io/thanos/thanos:' + cfg.version,
objectStorageConfig: {
name: 'thanos-objectstorage',
key: 'thanos.yaml',
},
volumeClaimTemplate: {
spec: {
accessModes: ['ReadWriteOnce'],
resources: {
requests: {
storage: '10Gi',
},
},
},
},
},
};
local b =
t.bucket +
commonConfig + {
config+:: {
name: 'thanos-bucket',
replicas: 1,
},
};
local c =
t.compact +
t.compact.withVolumeClaimTemplate +
t.compact.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-compact',
replicas: 1,
},
};
local re =
t.receive +
t.receive.withVolumeClaimTemplate +
t.receive.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-receive',
replicas: 1,
replicationFactor: 1,
},
};
local ru =
t.rule +
t.rule.withVolumeClaimTemplate +
t.rule.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-rule',
replicas: 1,
},
};
local s =
t.store +
t.store.withVolumeClaimTemplate +
t.store.withServiceMonitor +
commonConfig + {
config+:: {
name: 'thanos-store',
replicas: 1,
},
};
local swm =
t.store +
t.store.withVolumeClaimTemplate +
t.store.withServiceMonitor +
t.store.withIndexCacheMemcached +
t.store.withCachingBucketMemcached +
commonConfig + {
config+:: {
name: 'thanos-store',
replicas: 1,
memcached+: {
// NOTICE: <MEMCACHED_SERCIVE> is a placeholder to generate examples.
// List of memcached addresses, that will get resolved with the DNS service discovery provider.
// For DNS service discovery reference https://thanos.io/service-discovery.md/#dns-service-discovery
addresses: ['dnssrv+_client._tcp.<MEMCACHED_SERCIVE>.%s.svc.cluster.local' % commonConfig.config.namespace],
},
},
};
local q =
t.query +
t.query.withServiceMonitor +
t.query.withQueryTimeout +
commonConfig + {
config+:: {
name: 'thanos-query',
replicas: 1,
stores: [
'dnssrv+_grpc._tcp.%s.%s.svc.cluster.local' % [service.metadata.name, service.metadata.namespace]
for service in [re.service, ru.service, s.service]
],
replicaLabels: ['prometheus_replica', 'rule_replica'],
queryTimeout: '5m',
},
};
local finalRu = ru {
config+:: {
queriers: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [q.service.metadata.name, q.service.metadata.namespace]],
},
};
{ ['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]: q[name] for name in std.objectFields(q) } +
{ 'thanos-store-statefulSet-with-memcached': swm.statefulSet }