Config the monitoring stack components api urls using a VIP

When dashboard_frontend_vip is provided, all the services should be
configured using the related VIP. A new VIP variable is added for
both prometheus and alertmanager: we're already able to properly
config the grafana vip using dashboard_frontend_vip variable.
This change adds the same variable for both prometheus and
alertmanager.

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
pull/6475/head
Francesco Pantano 2021-04-09 17:16:03 +02:00 committed by Guillaume Abrioux
parent 06a998dde0
commit 441651638d
4 changed files with 25 additions and 5 deletions

View File

@ -665,6 +665,8 @@ dummy:
#dashboard_rgw_api_admin_resource: '' #dashboard_rgw_api_admin_resource: ''
#dashboard_rgw_api_no_ssl_verify: False #dashboard_rgw_api_no_ssl_verify: False
#dashboard_frontend_vip: '' #dashboard_frontend_vip: ''
#alertmanager_frontend_vip: ''
#prometheus_frontend_vip: ''
#node_exporter_container_image: "docker.io/prom/node-exporter:v0.17.0" #node_exporter_container_image: "docker.io/prom/node-exporter:v0.17.0"
#node_exporter_port: 9100 #node_exporter_port: 9100
#grafana_admin_user: admin #grafana_admin_user: admin

View File

@ -665,6 +665,8 @@ containerized_deployment: true
#dashboard_rgw_api_admin_resource: '' #dashboard_rgw_api_admin_resource: ''
#dashboard_rgw_api_no_ssl_verify: False #dashboard_rgw_api_no_ssl_verify: False
#dashboard_frontend_vip: '' #dashboard_frontend_vip: ''
#prometheus_frontend_vip: ''
#alertmanager_frontend_vip: ''
node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.6 node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.6
#node_exporter_port: 9100 #node_exporter_port: 9100
#grafana_admin_user: admin #grafana_admin_user: admin

View File

@ -188,12 +188,26 @@
vars: vars:
grafana_server_addr: '{{ item }}' grafana_server_addr: '{{ item }}'
- name: config grafana api url vip - name: config monitoring api url vip
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_frontend_vip }}:{{ grafana_port }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true run_once: true
changed_when: false block:
when: dashboard_frontend_vip is defined and dashboard_frontend_vip |length > 0 - name: config grafana api url vip
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_frontend_vip }}:{{ grafana_port }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
when: dashboard_frontend_vip is defined and dashboard_frontend_vip | length > 0
- name: config alertmanager api url
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ alertmanager_frontend_vip }}:{{ alertmanager_port }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
when: alertmanager_frontend_vip is defined and alertmanager_frontend_vip | length > 0
- name: config prometheus api url
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-prometheus-api-host {{ dashboard_protocol }}://{{ prometheus_frontend_vip }}:{{ prometheus_port }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
when: prometheus_frontend_vip is defined and prometheus_frontend_vip | length > 0
- name: dashboard object gateway management frontend - name: dashboard object gateway management frontend
when: groups.get(rgw_group_name, []) | length > 0 when: groups.get(rgw_group_name, []) | length > 0

View File

@ -657,6 +657,8 @@ dashboard_rgw_api_user_id: ceph-dashboard
dashboard_rgw_api_admin_resource: '' dashboard_rgw_api_admin_resource: ''
dashboard_rgw_api_no_ssl_verify: False dashboard_rgw_api_no_ssl_verify: False
dashboard_frontend_vip: '' dashboard_frontend_vip: ''
prometheus_frontend_vip: ''
alertmanager_frontend_vip: ''
node_exporter_container_image: "docker.io/prom/node-exporter:v0.17.0" node_exporter_container_image: "docker.io/prom/node-exporter:v0.17.0"
node_exporter_port: 9100 node_exporter_port: 9100
grafana_admin_user: admin grafana_admin_user: admin