From 0bc10e5b7c6930a8bc076894f701677654d0dd78 Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Fri, 9 Apr 2021 10:24:47 +0200 Subject: [PATCH] Add haproxy prometheus/alertmanager endpoint for Ceph Dashboard This change adds the prometheus and alertmanager endpoints which are on the same grafana network and allow us to just use a single vip to access the prometheus and alertmanager instances from the ceph dashboard when enabled. We already did it for grafana [1] and we would like to do the same for prometheus and alertmanager. [1] https://github.com/ceph/ceph-ansible/blob/master/roles/ceph-dashboard/tasks/configure_dashboard.yml#L192 Change-Id: I0dbcde302a3abdfccc3dd996b1c238e25064dd12 (cherry picked from commit 92c76046a8da94375ce626226b7e3cefec879639) --- manifests/haproxy.pp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp index 7c8f6489c..e759dbba8 100644 --- a/manifests/haproxy.pp +++ b/manifests/haproxy.pp @@ -720,6 +720,10 @@ class tripleo::haproxy ( zaqar_ws_ssl_port => 3000, ceph_grafana_port => 3100, ceph_grafana_ssl_port => 3100, + ceph_prometheus_port => 9092, + ceph_prometheus_ssl_port => 9092, + ceph_alertmanager_port => 9093, + ceph_alertmanager_ssl_port => 9093, ceph_dashboard_port => 8444, ceph_dashboard_ssl_port => 8444, } @@ -964,6 +968,34 @@ class tripleo::haproxy ( service_network => $ceph_grafana_network, member_options => union($haproxy_member_options, $internal_tls_member_options), } + ::tripleo::haproxy::endpoint { 'ceph_prometheus': + internal_ip => hiera('ceph_grafana_vip', $controller_virtual_ip), + service_port => $ports[ceph_prometheus_port], + ip_addresses => hiera('ceph_grafana_node_ips', $controller_hosts_real), + server_names => hiera('ceph_grafana_node_names', $controller_hosts_names_real), + mode => 'http', + public_ssl_port => $ports[ceph_prometheus_ssl_port], + listen_options => merge($default_listen_options, { + 'option' => [ 'httpchk GET /metrics' ], + 'balance' => 'source', + }), + service_network => $ceph_grafana_network, + member_options => $haproxy_member_options, + } + ::tripleo::haproxy::endpoint { 'ceph_alertmanager': + internal_ip => hiera('ceph_grafana_vip', $controller_virtual_ip), + service_port => $ports[ceph_alertmanager_port], + ip_addresses => hiera('ceph_grafana_node_ips', $controller_hosts_real), + server_names => hiera('ceph_grafana_node_names', $controller_hosts_names_real), + mode => 'http', + public_ssl_port => $ports[ceph_alertmanager_ssl_port], + listen_options => merge($default_listen_options, { + 'option' => [ 'httpchk GET /' ], + 'balance' => 'source', + }), + service_network => $ceph_grafana_network, + member_options => $haproxy_member_options, + } } if $ceph_dashboard {