@@ -49,24 +49,42 @@ local configMap = k.core.v1.configMap;
4949 rules+:: root.prometheusRules,
5050 },
5151
52- prometheus_config_map:: {},
53-
5452 prometheus_config_maps: [
5553 configMap.new('%s-config-0' % self .name) +
5654 configMap.withData({
5755 'prometheus.yml' : k.util.manifestYaml(root.prometheus_zero.config),
56+ }),
57+ configMap.new('%s-alerts-0' % self .name) +
58+ configMap.withData({
5859 'alerts.rules' : k.util.manifestYaml(root.prometheus_zero.alerts),
60+ }),
61+ configMap.new('%s-rules-0' % self .name) +
62+ configMap.withData({
5963 'recording.rules' : k.util.manifestYaml(root.prometheus_zero.rules),
6064 }),
65+
6166 configMap.new('%s-config-1' % self .name) +
6267 configMap.withData({
6368 'prometheus.yml' : k.util.manifestYaml(root.prometheus_one.config),
69+ }),
70+ configMap.new('%s-alerts-1' % self .name) +
71+ configMap.withData({
6472 'alerts.rules' : k.util.manifestYaml(root.prometheus_one.alerts),
73+ }),
74+ configMap.new('%s-rules-1' % self .name) +
75+ configMap.withData({
6576 'recording.rules' : k.util.manifestYaml(root.prometheus_one.rules),
6677 }),
6778 ],
6879
69- prometheus_config_mount:: {},
80+ prometheus_config_mount::
81+ k.util.configVolumeMount('%s-config-0' % self .name, '/etc/prometheus-0' )
82+ + k.util.configVolumeMount('%s-alerts-0' % self .name, '/etc/prometheus-0/alerts' )
83+ + k.util.configVolumeMount('%s-rules-0' % self .name, '/etc/prometheus-0/rules' )
84+ + k.util.configVolumeMount('%s-config-1' % self .name, '/etc/prometheus-1' )
85+ + k.util.configVolumeMount('%s-alerts-1' % self .name, '/etc/prometheus-1/alerts' )
86+ + k.util.configVolumeMount('%s-rules-1' % self .name, '/etc/prometheus-1/rules' )
87+ ,
7088
7189 prometheus_container+:: container.withEnv([
7290 container.envType.fromFieldPath('POD_NAME' , 'metadata.name' ),
@@ -82,7 +100,5 @@ local configMap = k.core.v1.configMap;
82100 ]),
83101
84102 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' ) +
87103 statefulset.mixin.spec.withReplicas(2 ),
88104}
0 commit comments