|
| 1 | +{ |
| 2 | + prometheus_config_0: $.prometheus_config, |
| 3 | + prometheus_config_1: $.prometheus_config, |
| 4 | + |
| 5 | + prometheusAlerts_0: $.prometheusAlerts, |
| 6 | + prometheusAlerts_1: $.prometheusAlerts, |
| 7 | + |
| 8 | + prometheusRules_0: $.prometheusRules, |
| 9 | + prometheusRules_1: $.prometheusRules, |
| 10 | + |
| 11 | + prometheus+:: { |
| 12 | + local configMap = $.core.v1.configMap, |
| 13 | + |
| 14 | + prometheus_config_map:: {}, |
| 15 | + |
| 16 | + prometheus_config_maps: [{ |
| 17 | + configMap.new('%s-config-0' % self.name) + |
| 18 | + configMap.withData({ |
| 19 | + 'prometheus.yml': $.util.manifestYaml($.prometheus_config_0), |
| 20 | + 'alerts.rules': $.util.manifestYaml($.prometheusAlerts_0), |
| 21 | + 'recording.rules': $.util.manifestYaml($.prometheusRules_0), |
| 22 | + }), |
| 23 | + configMap.new('%s-config-1' % self.name) + |
| 24 | + configMap.withData({ |
| 25 | + 'prometheus.yml': $.util.manifestYaml($.prometheus_config_1), |
| 26 | + 'alerts.rules': $.util.manifestYaml($.prometheusAlerts_1), |
| 27 | + 'recording.rules': $.util.manifestYaml($.prometheusRules_1), |
| 28 | + }), |
| 29 | + ]}, |
| 30 | + |
| 31 | + prometheus_config_mount:: {}, |
| 32 | + |
| 33 | + prometheus_init_container:: |
| 34 | + container.new('prometheus-init', 'busybox') + |
| 35 | + container.withCommand(["ln", "-s", "/etc/$HOSTNAME", "/etc/prometheus"]), |
| 36 | + |
| 37 | + prometheus_statefulset: |
| 38 | + $.util.configVolumeMount('%s-config-0' % self.name, '/etc/prometheus-0') + |
| 39 | + $.util.configVolumeMount('%s-config-1' % self.name, '/etc/prometheus-1') + |
| 40 | + statefulset.mixin.spec.template.spec.withInitContainers(self.prometheus_init_container) + |
| 41 | + statefulset.mixin.spec.withReplicas(2), |
| 42 | +} |
0 commit comments