@@ -4,38 +4,43 @@ local statefulset = k.apps.v1.statefulSet;
4
4
local configMap = k.core.v1.configMap;
5
5
6
6
{
7
- prometheus_config_0:: self .prometheus_config,
8
- prometheus_config_1:: self .prometheus_config,
7
+ local root = self ,
9
8
10
- prometheusAlerts_0:: self .prometheusAlerts,
11
- prometheusAlerts_1:: self .prometheusAlerts,
9
+ _config+:: {
10
+ prometheus_config_file: '/etc/$(POD_NAME)/prometheus.yml' ,
11
+ },
12
12
13
- prometheusRules_0:: self .prometheusRules,
14
- prometheusRules_1:: self .prometheusRules,
13
+ prometheus_zero+:: {
14
+ config+:: root.prometheus_config,
15
+ alerts+:: root.prometheusAlerts,
16
+ rules+:: root.prometheusRules,
17
+ },
15
18
16
- local prom = self ,
19
+ prometheus_one+:: {
20
+ config+:: root.prometheus_config,
21
+ alerts+:: root.prometheusAlerts,
22
+ rules+:: root.prometheusRules,
23
+ },
17
24
18
25
prometheus_config_map:: {},
19
26
20
27
prometheus_config_maps: [
21
28
configMap.new('%s-config-0' % self .name) +
22
29
configMap.withData({
23
- 'prometheus.yml' : k.util.manifestYaml(prom.prometheus_config_0 ),
24
- 'alerts.rules' : k.util.manifestYaml(prom.prometheusAlerts_0 ),
25
- 'recording.rules' : k.util.manifestYaml(prom.prometheusRules_0 ),
30
+ 'prometheus.yml' : k.util.manifestYaml(root.prometheus_zero.config ),
31
+ 'alerts.rules' : k.util.manifestYaml(root.prometheus_zero.alerts ),
32
+ 'recording.rules' : k.util.manifestYaml(root.prometheus_zero.rules ),
26
33
}),
27
34
configMap.new('%s-config-1' % self .name) +
28
35
configMap.withData({
29
- 'prometheus.yml' : k.util.manifestYaml(prom.prometheus_config_1 ),
30
- 'alerts.rules' : k.util.manifestYaml(prom.prometheusAlerts_1 ),
31
- 'recording.rules' : k.util.manifestYaml(prom.prometheusRules_1 ),
36
+ 'prometheus.yml' : k.util.manifestYaml(root.prometheus_one.config ),
37
+ 'alerts.rules' : k.util.manifestYaml(root.prometheus_one.alerts ),
38
+ 'recording.rules' : k.util.manifestYaml(root.prometheus_one.rules ),
32
39
}),
33
40
],
34
41
35
42
prometheus_config_mount:: {},
36
43
37
- prometheus_config_file:: '/etc/$(POD_NAME)/prometheus.yml' ,
38
-
39
44
prometheus_container+:: container.withEnv([
40
45
container.envType.fromFieldPath('POD_NAME' , 'metadata.name' ),
41
46
]),
0 commit comments