From f8477f928116aa8475af345a3b87cc095f327465 Mon Sep 17 00:00:00 2001 From: Jake Hutchinson Date: Mon, 9 Oct 2023 10:23:13 +0100 Subject: [PATCH] Various os_capacity fixes --- .yamllint | 1 + doc/source/configuration/monitoring.rst | 18 +++++++++++++----- .../templates/os_capacity-clouds.yml.j2 | 9 ++++++--- .../config/haproxy/services.d/os_exporter.cfg | 2 ++ ...{70-oscapacity.yml.j2 => 70-oscapacity.yml} | 2 ++ etc/kayobe/stackhpc-monitoring.yml | 10 ++++++++++ .../notes/os-capacity-94006f03f16583e4.yaml | 10 +++++++--- 7 files changed, 41 insertions(+), 11 deletions(-) rename etc/kayobe/kolla/config/prometheus/prometheus.yml.d/{70-oscapacity.yml.j2 => 70-oscapacity.yml} (80%) diff --git a/.yamllint b/.yamllint index 96b2b10dd..67c8f8a32 100644 --- a/.yamllint +++ b/.yamllint @@ -20,3 +20,4 @@ ignore: | .github/ .gitlab/ .gitlab-ci.yml + *etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml diff --git a/doc/source/configuration/monitoring.rst b/doc/source/configuration/monitoring.rst index 880ca0032..5cd19d124 100644 --- a/doc/source/configuration/monitoring.rst +++ b/doc/source/configuration/monitoring.rst @@ -141,17 +141,25 @@ OpenStack Capacity ================== OpenStack Capacity allows you to see how much space you have avaliable -in your cloud. StackHPC Kayobe Config includes this exporter by default -and it's necessary that some variables are set to allow deployment. +in your cloud. StackHPC Kayobe Config includes a playbook for manual +deployment, and it's necessary that some variables are set before +running this playbook. To successfully deploy OpenStack Capacity, you are required to specify the OpenStack application credentials in ``kayobe/secrets.yml`` as: .. code-block:: yaml - secrets_os_exporter_auth_url: - secrets_os_exporter_credential_id: - secrets_os_exporter_credential_secret: + secrets_os_capacity_auth_url: + secrets_os_capacity_credential_id: + secrets_os_capacity_credential_secret: + +Additionally, you are required to enable a conditional flag to allow +HAProxy configuration to be templated to controllers during deployment. + +.. code-block:: yaml + + stackhpc_enable_os_capacity: true After defining your credentials, You may deploy OpenStack Capacity using the ``ansible/deploy-os-capacity-exporter.yml`` Ansible playbook diff --git a/etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2 b/etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2 index 89d66c0bc..306ff9e78 100644 --- a/etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2 +++ b/etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2 @@ -1,10 +1,13 @@ clouds: openstack: auth: - auth_url: "{{ secrets_os_exporter_auth_url }}" - application_credential_id: "{{ secrets_os_exporter_credential_id }}" - application_credential_secret: "{{ secrets_os_exporter_credential_secret }}" + auth_url: "{{ secrets_os_capacity_auth_url }}" + application_credential_id: "{{ secrets_os_capacity_credential_id }}" + application_credential_secret: "{{ secrets_os_capacity_credential_secret }}" region_name: "RegionOne" interface: "internal" identity_api_version: 3 auth_type: "v3applicationcredential" +{% if kolla_enable_tls_internal | bool %} + verify: False +{% endif %} diff --git a/etc/kayobe/kolla/config/haproxy/services.d/os_exporter.cfg b/etc/kayobe/kolla/config/haproxy/services.d/os_exporter.cfg index 1292f38bd..e40c27a38 100644 --- a/etc/kayobe/kolla/config/haproxy/services.d/os_exporter.cfg +++ b/etc/kayobe/kolla/config/haproxy/services.d/os_exporter.cfg @@ -1,3 +1,4 @@ +{% if stackhpc_enable_os_capacity | bool %} {% raw %} frontend os_capacity_frontend mode http @@ -17,3 +18,4 @@ backend os_capacity_backend server {{ host_name }} {{ host_ip }}:9000 check inter 2000 rise 2 fall 5 {% endfor %} {% endraw %} +{% endif %} diff --git a/etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml.j2 b/etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml similarity index 80% rename from etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml.j2 rename to etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml index 1c0c25c15..4a6d1a802 100644 --- a/etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml.j2 +++ b/etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml @@ -1,3 +1,4 @@ +{% if stackhpc_enable_os_capacity | bool %} {% raw %} scrape_configs: - job_name: os-capacity @@ -7,3 +8,4 @@ scrape_configs: scrape_interval: 15m scrape_timeout: 10m {% endraw %} +{% endif %} diff --git a/etc/kayobe/stackhpc-monitoring.yml b/etc/kayobe/stackhpc-monitoring.yml index 43f1f309f..edd75ea30 100644 --- a/etc/kayobe/stackhpc-monitoring.yml +++ b/etc/kayobe/stackhpc-monitoring.yml @@ -9,3 +9,13 @@ alertmanager_low_memory_threshold_gib: 5 ############################################################################### + +############################################################################### +# Exporter configuration + +# Whether the OpenStack Capacity exporter is enabled. +# Enabling this flag will result in HAProxy configuration and Prometheus scrape +# targets being templated during deployment. +stackhpc_enable_os_capacity: false + +############################################################################### diff --git a/releasenotes/notes/os-capacity-94006f03f16583e4.yaml b/releasenotes/notes/os-capacity-94006f03f16583e4.yaml index f9d76b7f4..177122420 100644 --- a/releasenotes/notes/os-capacity-94006f03f16583e4.yaml +++ b/releasenotes/notes/os-capacity-94006f03f16583e4.yaml @@ -9,7 +9,11 @@ upgrade: - | To deploy the OpenStack Capacity Grafana dashboard, you must define OpenStack application credential variables: - ``secrets_os_exporter_auth_url``, - ``secrets_os_exporter_credential_id`` and - ``secrets_os_exporter_credential_secret`` as laid out in the + ``secrets_os_capacity_auth_url``, + ``secrets_os_capacity_credential_id`` and + ``secrets_os_capacity_credential_secret`` as laid out in the 'Monitoring' documentation. + + You must also enable the ``stackhpc_enable_os_capacity`` + flag for OpenStack Capacity HAProxy configuration to be + templated.