Skip to content

Commit b993fc2

Browse files
Various os_capacity fixes
1 parent 15fbd12 commit b993fc2

File tree

10 files changed

+374
-66
lines changed

10 files changed

+374
-66
lines changed

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ ignore: |
2020
.github/
2121
.gitlab/
2222
.gitlab-ci.yml
23+
*etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml

doc/source/configuration/monitoring.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,25 @@ OpenStack Capacity
141141
==================
142142

143143
OpenStack Capacity allows you to see how much space you have avaliable
144-
in your cloud. StackHPC Kayobe Config includes this exporter by default
145-
and it's necessary that some variables are set to allow deployment.
144+
in your cloud. StackHPC Kayobe Config includes a playbook for manual
145+
deployment, and it's necessary that some variables are set before
146+
running this playbook.
146147

147148
To successfully deploy OpenStack Capacity, you are required to specify
148149
the OpenStack application credentials in ``kayobe/secrets.yml`` as:
149150

150151
.. code-block:: yaml
151152
152-
secrets_os_exporter_auth_url: <some_auth_url>
153-
secrets_os_exporter_credential_id: <some_credential_id>
154-
secrets_os_exporter_credential_secret: <some_credential_secret>
153+
secrets_os_capacity_auth_url: <some_auth_url>
154+
secrets_os_capacity_credential_id: <some_credential_id>
155+
secrets_os_capacity_credential_secret: <some_credential_secret>
156+
157+
Additionally, you are required to enable a conditional flag to allow
158+
HAProxy configuration to be templated to controllers during deployment.
159+
160+
.. code-block:: yaml
161+
162+
stackhpc_enable_os_capacity: true
155163
156164
After defining your credentials, You may deploy OpenStack Capacity
157165
using the ``ansible/deploy-os-capacity-exporter.yml`` Ansible playbook

etc/kayobe/ansible/deploy-os-capacity-exporter.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,36 @@
44

55
tasks:
66
- name: Create os-capacity directory
7-
ansible.builtin.file:
7+
file:
88
path: /opt/kayobe/os-capacity/
99
state: directory
1010

11-
- name: Template clouds.yml
12-
ansible.builtin.template:
13-
src: templates/os_capacity-clouds.yml.j2
14-
dest: /opt/kayobe/os-capacity/clouds.yaml
11+
- name: Create env-file
12+
file:
13+
path: /opt/kayobe/os-capacity/env-file
14+
state: touch
15+
16+
- name: Read admin-openrc file
17+
shell:
18+
cmd: "cat $KOLLA_CONFIG_PATH/admin-openrc.sh | awk '{print $2}' | tail -n +5"
19+
register: credentials
20+
21+
- name: Write environment variables to env-file
22+
copy:
23+
content: "{{ credentials.stdout_lines }}"
24+
dest: /opt/kayobe/os-capacity/env-file
25+
26+
- name: Set TLS verification to false.
27+
lineinfile:
28+
path: /opt/kayobe/os-capacity/env-file
29+
line: "OS_INSECURE=1"
30+
when: kolla_enable_tls_internal | bool
1531

1632
- name: Ensure os_capacity container is running
1733
docker_container:
1834
name: os_capacity
1935
image: ghcr.io/stackhpc/os-capacity:master
20-
env:
21-
OS_CLOUD: openstack
22-
OS_CLIENT_CONFIG_FILE: /etc/openstack/clouds.yaml
36+
env-file: /opt/kayobe/os-capacity/env-file
2337
mounts:
2438
- type: bind
2539
source: /opt/kayobe/os-capacity/
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
clouds:
22
openstack:
33
auth:
4-
auth_url: "{{ secrets_os_exporter_auth_url }}"
5-
application_credential_id: "{{ secrets_os_exporter_credential_id }}"
6-
application_credential_secret: "{{ secrets_os_exporter_credential_secret }}"
4+
auth_url: "{{ secrets_os_capacity_auth_url }}"
5+
application_credential_id: "{{ secrets_os_capacity_credential_id }}"
6+
application_credential_secret: "{{ secrets_os_capacity_credential_secret }}"
77
region_name: "RegionOne"
88
interface: "internal"
99
identity_api_version: 3
1010
auth_type: "v3applicationcredential"
11+
{% if kolla_enable_tls_internal | bool %}
12+
verify: False
13+
{% endif %}

etc/kayobe/kolla/config/grafana/dashboards/openstack/grafana_cloud_dashboard.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{% raw %}
21
{
32
"annotations": {
43
"list": [
@@ -25,7 +24,6 @@
2524
"editable": true,
2625
"fiscalYearStartMonth": 0,
2726
"graphTooltip": 0,
28-
"id": 2084495,
2927
"links": [],
3028
"liveNow": false,
3129
"panels": [
@@ -86,7 +84,7 @@
8684
},
8785
"textMode": "auto"
8886
},
89-
"pluginVersion": "9.4.7",
87+
"pluginVersion": "10.1.2",
9088
"repeat": "flavors",
9189
"repeatDirection": "h",
9290
"targets": [
@@ -424,6 +422,7 @@
424422
"tooltip": false,
425423
"viz": false
426424
},
425+
"insertNulls": false,
427426
"lineInterpolation": "linear",
428427
"lineWidth": 1,
429428
"pointSize": 5,
@@ -465,6 +464,7 @@
465464
"y": 17
466465
},
467466
"id": 5,
467+
"interval": "30m",
468468
"options": {
469469
"legend": {
470470
"calcs": [
@@ -522,6 +522,7 @@
522522
"tooltip": false,
523523
"viz": false
524524
},
525+
"insertNulls": false,
525526
"lineInterpolation": "linear",
526527
"lineWidth": 1,
527528
"pointSize": 5,
@@ -563,6 +564,7 @@
563564
"y": 17
564565
},
565566
"id": 16,
567+
"interval": "30m",
566568
"options": {
567569
"legend": {
568570
"calcs": [
@@ -646,6 +648,7 @@
646648
"tooltip": false,
647649
"viz": false
648650
},
651+
"insertNulls": false,
649652
"lineInterpolation": "smooth",
650653
"lineStyle": {
651654
"fill": "solid"
@@ -689,6 +692,7 @@
689692
"y": 26
690693
},
691694
"id": 6,
695+
"interval": "30m",
692696
"options": {
693697
"legend": {
694698
"calcs": [
@@ -750,6 +754,7 @@
750754
"tooltip": false,
751755
"viz": false
752756
},
757+
"insertNulls": false,
753758
"lineInterpolation": "linear",
754759
"lineWidth": 1,
755760
"pointSize": 5,
@@ -791,6 +796,7 @@
791796
"y": 26
792797
},
793798
"id": 4,
799+
"interval": "30m",
794800
"options": {
795801
"legend": {
796802
"calcs": [
@@ -836,7 +842,7 @@
836842
"current": {
837843
"selected": false,
838844
"text": "Prometheus",
839-
"value": "Prometheus"
845+
"value": "PBFA97CFB590B2093"
840846
},
841847
"description": "The prometheus datasource used for queries.",
842848
"hide": 0,
@@ -885,7 +891,7 @@
885891
]
886892
},
887893
"time": {
888-
"from": "now-24h",
894+
"from": "now-2d",
889895
"to": "now"
890896
},
891897
"timepicker": {},
@@ -894,5 +900,4 @@
894900
"uid": "g__ksD67z",
895901
"version": 1,
896902
"weekStart": ""
897-
}
898-
{% endraw %}
903+
}

0 commit comments

Comments
 (0)