Skip to content

Add Openstack Capacity to StackHPC Kayobe Config #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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