From 13dd9309df09ddeb691d18d1869a5a35fce7b7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20J=C3=A4ger?= Date: Wed, 28 Feb 2024 13:55:26 +0100 Subject: [PATCH] Skyline configure Prometheus Change-Id: I0a086c59076120aa53e6a05526dbab88e393c1c7 --- ansible/group_vars/all.yml | 1 + ansible/roles/prometheus/defaults/main.yml | 3 +++ ansible/roles/prometheus/tasks/precheck.yml | 8 ++++++++ ansible/roles/skyline/templates/skyline.yaml.j2 | 6 ++++++ .../logging-and-monitoring/prometheus-guide.rst | 12 ++++++++---- etc/kolla/passwords.yml | 1 + ...kyline-configure-prometheus-f86aea1beebcc379.yaml | 7 +++++++ 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/skyline-configure-prometheus-f86aea1beebcc379.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 695f7a85a3..9cfaee7668 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1294,6 +1294,7 @@ enable_prometheus_msteams: "no" prometheus_alertmanager_user: "admin" prometheus_ceph_exporter_interval: "{{ prometheus_scrape_interval }}" prometheus_grafana_user: "grafana" +prometheus_skyline_user: "skyline" prometheus_scrape_interval: "60s" prometheus_openstack_exporter_interval: "{{ prometheus_scrape_interval }}" prometheus_openstack_exporter_timeout: "45s" diff --git a/ansible/roles/prometheus/defaults/main.yml b/ansible/roles/prometheus/defaults/main.yml index 1134b294ff..cdd3cf485e 100644 --- a/ansible/roles/prometheus/defaults/main.yml +++ b/ansible/roles/prometheus/defaults/main.yml @@ -154,6 +154,9 @@ prometheus_basic_auth_users_default: - username: "{{ prometheus_grafana_user }}" password: "{{ prometheus_grafana_password }}" enabled: "{{ enable_grafana }}" + - username: "{{ prometheus_skyline_user }}" + password: "{{ prometheus_skyline_password }}" + enabled: "{{ enable_skyline }}" prometheus_basic_auth_users_extra: [] diff --git a/ansible/roles/prometheus/tasks/precheck.yml b/ansible/roles/prometheus/tasks/precheck.yml index 29b71e3167..a9487ae970 100644 --- a/ansible/roles/prometheus/tasks/precheck.yml +++ b/ansible/roles/prometheus/tasks/precheck.yml @@ -46,6 +46,14 @@ - prometheus_grafana_password | length > 0 when: enable_grafana | bool +- name: Check that prometheus_skyline_password is correctly set + assert: + that: + - prometheus_skyline_password is defined + - prometheus_skyline_password is string + - prometheus_skyline_password | length > 0 + when: enable_skyline | bool + - name: Checking free port for Prometheus server wait_for: host: "{{ 'api' | kolla_address }}" diff --git a/ansible/roles/skyline/templates/skyline.yaml.j2 b/ansible/roles/skyline/templates/skyline.yaml.j2 index f998109546..b6bb53b577 100644 --- a/ansible/roles/skyline/templates/skyline.yaml.j2 +++ b/ansible/roles/skyline/templates/skyline.yaml.j2 @@ -5,6 +5,12 @@ default: database_url: mysql://{{ skyline_database_user }}:{{ skyline_database_password }}@{{ skyline_database_address }}/{{ skyline_database_name }} debug: {{ skyline_logging_debug }} log_dir: {{ log_dir }} +{% if enable_prometheus | bool %} + prometheus_basic_auth_password: "{{ prometheus_skyline_password }}" + prometheus_basic_auth_user: "{{ prometheus_skyline_user }}" + prometheus_enable_basic_auth: true + prometheus_endpoint: "{{ prometheus_internal_endpoint }}" +{% endif %} secret_key: {{ skyline_secret_key }} session_name: {{ skyline_session_name }} openstack: diff --git a/doc/source/reference/logging-and-monitoring/prometheus-guide.rst b/doc/source/reference/logging-and-monitoring/prometheus-guide.rst index cc2f632988..a36e906f2e 100644 --- a/doc/source/reference/logging-and-monitoring/prometheus-guide.rst +++ b/doc/source/reference/logging-and-monitoring/prometheus-guide.rst @@ -38,10 +38,14 @@ Basic Auth ~~~~~~~~~~ Prometheus is protected with basic HTTP authentication. Kolla-ansible will -create the following users: ``admin`` and ``grafana`` (if grafana is -enabled). The grafana username can be overidden using the variable -``prometheus_grafana_user``. The passwords are defined by the -``prometheus_password`` and ``prometheus_grafana_password`` variables in +create the following users: ``admin``, ``grafana`` (if grafana is +enabled) and ``skyline`` (if skyline is enabled). The grafana username can +be overidden using the variable +``prometheus_grafana_user``, the skyline username can +be overidden using the variable ``prometheus_skyline_user``. +The passwords are defined by the +``prometheus_password``, ``prometheus_grafana_password`` and +``prometheus_skyline_password`` variables in ``passwords.yml``. The list of basic auth users can be extended using the ``prometheus_basic_auth_users_extra`` variable: diff --git a/etc/kolla/passwords.yml b/etc/kolla/passwords.yml index f59ab1cea3..41c7934f8d 100644 --- a/etc/kolla/passwords.yml +++ b/etc/kolla/passwords.yml @@ -249,6 +249,7 @@ prometheus_mysql_exporter_database_password: prometheus_alertmanager_password: prometheus_password: prometheus_grafana_password: +prometheus_skyline_password: prometheus_bcrypt_salt: ############################### diff --git a/releasenotes/notes/skyline-configure-prometheus-f86aea1beebcc379.yaml b/releasenotes/notes/skyline-configure-prometheus-f86aea1beebcc379.yaml new file mode 100644 index 0000000000..de46d880e5 --- /dev/null +++ b/releasenotes/notes/skyline-configure-prometheus-f86aea1beebcc379.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Configure Skyline's Prometheus connection to make the Monitor Center work. + The latest Skyline Console has now a Monitor Center in the administrator + view that displays information from Prometheus. For that to work the + Prometheus connection needs to be set up in skyline.yaml.