@@ -29,7 +29,7 @@ local configMap = k.core.v1.configMap;
29
29
config+:: root.prometheus_config {
30
30
global+: {
31
31
external_labels+: {
32
- __replica__: 'zero ' ,
32
+ __replica__: 'prometheus-0 ' ,
33
33
},
34
34
},
35
35
},
@@ -41,32 +41,50 @@ local configMap = k.core.v1.configMap;
41
41
config+:: root.prometheus_config {
42
42
global+: {
43
43
external_labels+: {
44
- __replica__: 'one ' ,
44
+ __replica__: 'prometheus-1 ' ,
45
45
},
46
46
},
47
47
},
48
48
alerts+:: root.prometheusAlerts,
49
49
rules+:: root.prometheusRules,
50
50
},
51
51
52
- prometheus_config_map:: {},
53
-
54
52
prometheus_config_maps: [
55
- configMap.new('%s-config-0 ' % self .name) +
53
+ configMap.new('%s-0-config ' % self .name) +
56
54
configMap.withData({
57
55
'prometheus.yml' : k.util.manifestYaml(root.prometheus_zero.config),
56
+ }),
57
+ configMap.new('%s-0-alerts' % self .name) +
58
+ configMap.withData({
58
59
'alerts.rules' : k.util.manifestYaml(root.prometheus_zero.alerts),
60
+ }),
61
+ configMap.new('%s-0-recording' % self .name) +
62
+ configMap.withData({
59
63
'recording.rules' : k.util.manifestYaml(root.prometheus_zero.rules),
60
64
}),
61
- configMap.new('%s-config-1' % self .name) +
65
+
66
+ configMap.new('%s-1-config' % self .name) +
62
67
configMap.withData({
63
68
'prometheus.yml' : k.util.manifestYaml(root.prometheus_one.config),
69
+ }),
70
+ configMap.new('%s-1-alerts' % self .name) +
71
+ configMap.withData({
64
72
'alerts.rules' : k.util.manifestYaml(root.prometheus_one.alerts),
73
+ }),
74
+ configMap.new('%s-1-recording' % self .name) +
75
+ configMap.withData({
65
76
'recording.rules' : k.util.manifestYaml(root.prometheus_one.rules),
66
77
}),
67
78
],
68
79
69
- prometheus_config_mount:: {},
80
+ prometheus_config_mount::
81
+ k.util.configVolumeMount('%s-0-config' % self .name, '/etc/prometheus-0' )
82
+ + k.util.configVolumeMount('%s-0-alerts' % self .name, '/etc/prometheus-0/alerts' )
83
+ + k.util.configVolumeMount('%s-0-recording' % self .name, '/etc/prometheus-0/recording' )
84
+ + k.util.configVolumeMount('%s-1-config' % self .name, '/etc/prometheus-1' )
85
+ + k.util.configVolumeMount('%s-1-alerts' % self .name, '/etc/prometheus-1/alerts' )
86
+ + k.util.configVolumeMount('%s-1-recording' % self .name, '/etc/prometheus-1/recording' )
87
+ ,
70
88
71
89
prometheus_container+:: container.withEnv([
72
90
container.envType.fromFieldPath('POD_NAME' , 'metadata.name' ),
@@ -82,7 +100,5 @@ local configMap = k.core.v1.configMap;
82
100
]),
83
101
84
102
prometheus_statefulset+:
85
- k.util.configVolumeMount('%s-config-0' % self .name, '/etc/prometheus-0' ) +
86
- k.util.configVolumeMount('%s-config-1' % self .name, '/etc/prometheus-1' ) +
87
103
statefulset.mixin.spec.withReplicas(2 ),
88
104
}
0 commit comments