Skip to content

Commit

Permalink
Merge pull request #678 from stackhpc/os_capacity
Browse files Browse the repository at this point in the history
Add Openstack Capacity to StackHPC Kayobe Config
  • Loading branch information
mnasiadka authored Oct 6, 2023
2 parents c090564 + 6739b7f commit 6497dde
Show file tree
Hide file tree
Showing 8 changed files with 1,896 additions and 0 deletions.
36 changes: 36 additions & 0 deletions doc/source/configuration/monitoring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,39 @@ mgrs group and list them as the endpoints for prometheus. Additionally,
depending on your configuration, you may need set the
``kolla_enable_prometheus_ceph_mgr_exporter`` variable to ``true`` in order to
enable the ceph mgr exporter.

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.

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: <some_auth_url>
secrets_os_exporter_credential_id: <some_credential_id>
secrets_os_exporter_credential_secret: <some_credential_secret>
After defining your credentials, You may deploy OpenStack Capacity
using the ``ansible/deploy-os-capacity-exporter.yml`` Ansible playbook
via Kayobe.

.. code-block:: console
kayobe playbook run ansible/deploy-os-capacity-exporter.yml
It is required that you re-configure the Prometheus, Grafana and HAProxy
services following deployment, to do this run the following Kayobe command.

.. code-block:: console
kayobe overcloud service reconfigure -kt grafana,prometheus,haproxy
If you notice ``HaproxyServerDown`` or ``HaproxyBackendDown`` prometheus
alerts after deployment it's likely the os_exporter secrets have not been
set correctly, double check you have entered the correct authentication
information appropiate to your cloud and re-deploy.
29 changes: 29 additions & 0 deletions etc/kayobe/ansible/deploy-os-capacity-exporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
- hosts: monitoring
gather_facts: false

tasks:
- name: Create os-capacity directory
ansible.builtin.file:
path: /opt/kayobe/os-capacity/
state: directory

- name: Template clouds.yml
ansible.builtin.template:
src: templates/os_capacity-clouds.yml.j2
dest: /opt/kayobe/os-capacity/clouds.yaml

- name: Ensure os_capacity container is running
docker_container:
name: os_capacity
image: ghcr.io/stackhpc/os-capacity:master
env:
OS_CLOUD: openstack
OS_CLIENT_CONFIG_FILE: /etc/openstack/clouds.yaml
mounts:
- type: bind
source: /opt/kayobe/os-capacity/
target: /etc/openstack/
network_mode: host
restart_policy: unless-stopped
become: true
10 changes: 10 additions & 0 deletions etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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 }}"
region_name: "RegionOne"
interface: "internal"
identity_api_version: 3
auth_type: "v3applicationcredential"
Loading

0 comments on commit 6497dde

Please sign in to comment.