mirror of https://github.com/ceph/ceph-ansible.git
ceph-prometheus: add alertmanager HA config
When using multiple alertmanager nodes (via the grafana-server group) then we need to specify the other peers in the configuration. https://prometheus.io/docs/alerting/alertmanager/#high-availability https://github.com/prometheus/alertmanager#high-availability Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1792225 Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>pull/5054/head
parent
5a03e0ee1c
commit
b9d975385c
|
@ -777,6 +777,7 @@ dummy:
|
|||
#alertmanager_data_dir: /var/lib/alertmanager
|
||||
#alertmanager_conf_dir: /etc/alertmanager
|
||||
#alertmanager_port: 9093
|
||||
#alertmanager_cluster_port: 9094
|
||||
|
||||
|
||||
##################################
|
||||
|
|
|
@ -777,6 +777,7 @@ alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alert
|
|||
#alertmanager_data_dir: /var/lib/alertmanager
|
||||
#alertmanager_conf_dir: /etc/alertmanager
|
||||
#alertmanager_port: 9093
|
||||
#alertmanager_cluster_port: 9094
|
||||
|
||||
|
||||
##################################
|
||||
|
|
|
@ -769,6 +769,7 @@ alertmanager_container_memory: 4
|
|||
alertmanager_data_dir: /var/lib/alertmanager
|
||||
alertmanager_conf_dir: /etc/alertmanager
|
||||
alertmanager_port: 9093
|
||||
alertmanager_cluster_port: 9094
|
||||
|
||||
|
||||
##################################
|
||||
|
|
|
@ -52,6 +52,17 @@
|
|||
permanent: true
|
||||
immediate: true
|
||||
state: enabled
|
||||
|
||||
- name: open alertmanager cluster port
|
||||
firewalld:
|
||||
port: "{{ alertmanager_cluster_port }}/{{ item }}"
|
||||
zone: "{{ ceph_dashboard_firewall_zone }}"
|
||||
permanent: true
|
||||
immediate: true
|
||||
state: enabled
|
||||
with_items:
|
||||
- "tcp"
|
||||
- "udp"
|
||||
when:
|
||||
- grafana_server_group_name is defined
|
||||
- grafana_server_group_name in group_names
|
||||
|
|
|
@ -22,9 +22,13 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=alertmanager \
|
|||
--memory-swap={{ alertmanager_container_memory * 2 }}GB \
|
||||
{{ alertmanager_container_image }} \
|
||||
--config.file=/etc/alertmanager/alertmanager.yml \
|
||||
--cluster.listen-address={{ grafana_server_addr }}:{{ alertmanager_cluster_port }} \
|
||||
{% for peer in grafana_server_addrs|difference(grafana_server_addr) %}
|
||||
--cluster.peer={{ peer }}:{{ alertmanager_cluster_port }} \
|
||||
{% endfor %}
|
||||
--storage.path=/alertmanager \
|
||||
--web.external-url=http://{{ ansible_fqdn }}:{{ alertmanager_port }}/ \
|
||||
--web.listen-address=:{{ alertmanager_port }}
|
||||
--web.listen-address={{ grafana_server_addr }}:{{ alertmanager_port }}
|
||||
ExecStop=/usr/bin/{{ container_binary }} stop alertmanager
|
||||
KillMode=none
|
||||
Restart=always
|
||||
|
|
Loading…
Reference in New Issue