Skip to content

Commit 29cd0b1

Browse files
OS Capacity: Support providing a CA certificate
For clouds that use an internal CA, it is necessary to provide a CA certificate to OS capacity. Co-Authored-By: Jake Hutchinson <[email protected]>
1 parent 1d2946a commit 29cd0b1

File tree

7 files changed

+42
-3
lines changed

7 files changed

+42
-3
lines changed

doc/source/configuration/monitoring.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,21 @@ project domain name in ``stackhpc-monitoring.yml``:
160160
stackhpc_os_capacity_openstack_region_name: <openstack_region_name>
161161
162162
Additionally, you should ensure these credentials have the correct permissions
163-
for the exporter. If you are deploying in a cloud with internal TLS, you may be required
164-
to disable certificate verification for the OpenStack Capacity exporter
165-
if your certificate is not signed by a trusted CA.
163+
for the exporter.
164+
165+
.. _os-capacity-cacert:
166+
167+
If you are deploying in a cloud with internal TLS, you may be required
168+
to provide a CA certificate for the OpenStack Capacity exporter if your
169+
certificate is not signed by a trusted CA. For example, to use a CA certificate
170+
named ``vault.crt`` that is also added to the Kolla containers:
171+
172+
.. code-block:: yaml
173+
174+
stackhpc_os_capacity_openstack_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/vault.crt"
175+
176+
Alternatively, to disable certificate verification for the OpenStack Capacity
177+
exporter:
166178

167179
.. code-block:: yaml
168180

doc/source/configuration/vault.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ Enable the required TLS variables in kayobe and kolla
196196
# Whether TLS is enabled for the internal API endpoints. Default is 'no'.
197197
kolla_enable_tls_internal: yes
198198
199+
See :ref:`os-capacity-cacert` for information on adding CA certificates to the trust store when deploying the OpenStack Capacity exporter.
200+
199201
2. Set the following in etc/kayobe/kolla/globals.yml or if environments are being used etc/kayobe/environments/$KAYOBE_ENVIRONMENT/kolla/globals.yml
200202

201203
.. code-block::

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
delegate_to: localhost
2828
register: credential
2929
when: stackhpc_enable_os_capacity
30+
changed_when: false
3031

3132
- name: Set facts for admin credentials
3233
ansible.builtin.set_fact:
@@ -43,6 +44,16 @@
4344
src: templates/os_capacity-clouds.yml.j2
4445
dest: /opt/kayobe/os-capacity/clouds.yaml
4546
when: stackhpc_enable_os_capacity
47+
register: clouds_yaml_result
48+
49+
- name: Copy CA certificate to OpenStack Capacity nodes
50+
ansible.builtin.copy:
51+
src: "{{ stackhpc_os_capacity_openstack_cacert }}"
52+
dest: /opt/kayobe/os-capacity/cacert.pem
53+
when:
54+
- stackhpc_enable_os_capacity
55+
- stackhpc_os_capacity_openstack_cacert | length > 0
56+
register: cacert_result
4657

4758
- name: Ensure os_capacity container is running
4859
community.docker.docker_container:
@@ -56,6 +67,7 @@
5667
source: /opt/kayobe/os-capacity/
5768
target: /etc/openstack/
5869
network_mode: host
70+
restart: "{{ clouds_yaml_result is changed or cacert_result is changed }}"
5971
restart_policy: unless-stopped
6072
become: true
6173
when: stackhpc_enable_os_capacity

etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ clouds:
1010
interface: "internal"
1111
identity_api_version: 3
1212
auth_type: "password"
13+
{% if stackhpc_os_capacity_openstack_cacert | length > 0 %}
14+
cacert: /etc/openstack/cacert.pem
15+
{% endif %}
1316
{% if not stackhpc_os_capacity_openstack_verify | bool %}
1417
verify: False
1518
{% endif %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
# Path to a CA certificate file to trust in the OpenStack Capacity exporter.
3+
stackhpc_os_capacity_openstack_cacert: "{{ kayobe_env_config_path }}/kolla/certificates/ca/vault.crt"

etc/kayobe/stackhpc-monitoring.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ alertmanager_warn_network_bond_single_link: true
2020
# targets being templated during deployment.
2121
stackhpc_enable_os_capacity: true
2222

23+
# Path to a CA certificate file to trust in the OpenStack Capacity exporter.
24+
stackhpc_os_capacity_openstack_cacert: ""
25+
2326
# Whether TLS certificate verification is enabled for the OpenStack Capacity
2427
# exporter during Keystone authentication.
2528
stackhpc_os_capacity_openstack_verify: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
features:
3+
- |
4+
Adds support for providing a CA certificate for OpenStack Capacity exporter.

0 commit comments

Comments
 (0)