Skip to content

Commit c3acfa8

Browse files
committed
Put the RadosGW Usage Exporter behind HAProxy
1 parent ae13db3 commit c3acfa8

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

etc/kayobe/ansible/deploy-radosgw-usage-exporter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
ADMIN_ENTRY: admin
115115
ACCESS_KEY: "{{ ec2.Access }}"
116116
SECRET_KEY: "{{ ec2.Secret }}"
117-
VIRTUAL_PORT: "{{ stackhpc_radosgw_usage_exporter_port | string }}"
117+
VIRTUAL_PORT: "{{ stackhpc_radosgw_usage_exporter_backend_port | string }}"
118118
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
119119
entrypoint: "{{ ['python', '-u', './radosgw_usage_exporter.py', '--insecure'] if not stackhpc_radosgw_usage_exporter_verify else omit }}"
120120
vars:

etc/kayobe/kolla.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ kolla_build_args: {}
560560
kolla_overcloud_inventory_pass_through_host_vars_extra:
561561
- stackhpc_gpu_data
562562
- gpu_group_map
563+
- stackhpc_radosgw_usage_exporter_frontend_port
564+
- stackhpc_radosgw_usage_exporter_backend_port
563565

564566
# List of names of host variables to pass through from kayobe hosts to
565567
# kolla-ansible hosts, if set. See also
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% if stackhpc_enable_radosgw_usage_exporter | bool %}
2+
{% raw %}
3+
frontend radosgw_usage_exporter_frontend
4+
mode http
5+
http-request del-header X-Forwarded-Proto
6+
option httplog
7+
option forwardfor
8+
http-request set-header X-Forwarded-Proto https if { ssl_fc }
9+
{% if kolla_enable_tls_internal | bool %}
10+
bind {{ kolla_internal_vip_address }}:{{ stackhpc_radosgw_usage_exporter_frontend_port }} ssl crt /etc/haproxy/certificates/haproxy-internal.pem
11+
{% else %}
12+
bind {{ kolla_internal_vip_address }}:{{ stackhpc_radosgw_usage_exporter_frontend_port }}
13+
{% endif %}
14+
default_backend radosgw_usage_exporter_backend
15+
16+
backend radosgw_usage_exporter_backend
17+
mode http
18+
19+
{% for host in groups['monitoring'] %}
20+
{% set host_name = hostvars[host].ansible_facts.hostname %}
21+
{% set host_ip = 'api' | kolla_address(host) %}
22+
server {{ host_name }} {{ host_ip }}:{{ stackhpc_radosgw_usage_exporter_backend_port }} check inter 2000 rise 2 fall 5
23+
{% endfor %}
24+
{% endraw %}
25+
{% endif %}

etc/kayobe/kolla/config/prometheus/prometheus.yml.d/80-radosgw-exporter.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ scrape_configs:
1414
regex: (.+)
1515
static_configs:
1616
- targets:
17-
{% for host in groups['monitoring'] %}
18-
- "{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{% endraw %}{{ stackhpc_radosgw_usage_exporter_port }}{% raw %}"
19-
{% endfor %}
17+
- "{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ stackhpc_radosgw_usage_exporter_frontend_port }}"
18+
{% if kolla_enable_tls_internal | bool %}
19+
scheme: https
20+
{% endif %}
2021
{% endraw %}
2122
{% endif %}

etc/kayobe/stackhpc-monitoring.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ stackhpc_prometheus_openstack_exporter_interval: 300
7474
# Prometheus scrape targets during deployment.
7575
stackhpc_enable_radosgw_usage_exporter: false
7676

77-
# Port to expose RADOS gateway usage exporter. Default is 9242
78-
stackhpc_radosgw_usage_exporter_port: 9242
77+
# Port to expose RADOS gateway usage exporter backend. Default is 9242
78+
stackhpc_radosgw_usage_exporter_backend_port: 9242
79+
80+
# Port to expose RADOS gateway usage exporter frontend (via HAProxy). Default is 9240
81+
stackhpc_radosgw_usage_exporter_frontend_port: 9240
7982

8083
# Path to a certificate for internal TLS in the RADOS gateway usage exporter.
8184
stackhpc_radosgw_usage_exporter_cacert: ""

0 commit comments

Comments
 (0)