Skip to content

Commit 84e7994

Browse files
authored
Merge pull request #1028 from stackhpc/generic-blackbox
Add generic blackbox monitoring configuration
2 parents 51ac287 + 12815dd commit 84e7994

File tree

5 files changed

+235
-0
lines changed

5 files changed

+235
-0
lines changed

etc/kayobe/environments/ci-aio/stackhpc-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ stackhpc_docker_registry_password: "{{ stackhpc_repo_mirror_password }}"
6565
pulp_url: "{{ stackhpc_repo_mirror_url }}"
6666
pulp_username: "{{ stackhpc_repo_mirror_username }}"
6767
pulp_password: "{{ stackhpc_repo_mirror_password }}"
68+
69+
# Ensure Blackbox monitoring configuration is generated correctly
70+
seed_pulp_container_enabled: false
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# yamllint disable-file
2+
modules:
3+
http_2xx:
4+
prober: http
5+
os_endpoint:
6+
prober: http
7+
http:
8+
valid_status_codes: [200,300]
9+
headers:
10+
Content-Type: application/json
11+
fail_if_body_not_matches_regexp:
12+
- "versions"
13+
http_post_2xx:
14+
prober: http
15+
http:
16+
method: POST
17+
tcp_connect:
18+
prober: tcp
19+
tls_connect:
20+
prober: tcp
21+
tcp:
22+
tls: true
23+
ssh_banner:
24+
prober: tcp
25+
tcp:
26+
query_response:
27+
- expect: "^SSH-2.0-"
28+
icmp:
29+
prober: icmp
30+
http_2xx_os_dashboards:
31+
prober: http
32+
timeout: 5s
33+
http:
34+
basic_auth:
35+
{% raw %}
36+
username: {{ opensearch_dashboards_user }}
37+
password: {{ opensearch_dashboards_password }}
38+
{% endraw %}
39+
http_2xx_prometheus:
40+
prober: http
41+
timeout: 5s
42+
http:
43+
basic_auth:
44+
{% raw %}
45+
username: admin
46+
password: {{ prometheus_password }}
47+
{% endraw %}
48+
http_2xx_alertmanager:
49+
prober: http
50+
timeout: 5s
51+
http:
52+
basic_auth:
53+
{% raw %}
54+
username: {{ prometheus_alertmanager_user }}
55+
password: {{ prometheus_alertmanager_password }}
56+
{% endraw %}

etc/kayobe/kolla/globals.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ prometheus_instance_label: "{% raw %}{{ ansible_facts.hostname }}{% endraw %}"
5353
# in Yoga. This is required to include a valid value for the flavor_id label on
5454
# openstack_nova_server_status metrics.
5555
prometheus_openstack_exporter_compute_api_version: "2.1"
56+
57+
# The Pulp URL must be templated by Kayobe rather than Kolla Ansible.
58+
# The rest of the Prometheus Blackbox exporter configuration can be found in
59+
# the Kolla inventory.
60+
prometheus_blackbox_exporter_endpoints_kayobe:
61+
- endpoints:
62+
- "pulp:http_2xx:{{ pulp_url }}/pulp/api/v3/status/"
63+
enabled: "{{ seed_pulp_container_enabled | bool }}"
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
########################################
3+
# Prometheus Blackbox monitoring options
4+
########################################
5+
6+
# prometheus_blackbox_exporter_endpoints_kayobe is another set of default
7+
# endpoints that are templated by Kayobe rather than Kolla Ansible. See
8+
# kolla/globals.yml for more details.
9+
prometheus_blackbox_exporter_endpoints: >-
10+
{{ (prometheus_blackbox_exporter_endpoints_kayobe | default([]) +
11+
prometheus_blackbox_exporter_endpoints_default) |
12+
selectattr('enabled', 'true') |
13+
map(attribute='endpoints') | flatten |
14+
union(prometheus_blackbox_exporter_endpoints_custom) |
15+
unique | select | list }}
16+
17+
# A list of custom prometheus Blackbox exporter endpoints. Each element should
18+
# have the following format:
19+
# - name:module:endpoint
20+
# for example
21+
# - stackhpc:http_2xx:https://stackhpc.com:443
22+
prometheus_blackbox_exporter_endpoints_custom: []
23+
24+
prometheus_blackbox_exporter_endpoints_default:
25+
# OpenStack endpoints
26+
- endpoints:
27+
- "barbican:os_endpoint:{{ barbican_public_endpoint }}"
28+
- "{{ ('barbican_internal:os_endpoint:' + barbican_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
29+
enabled: "{{ enable_barbican | bool }}"
30+
- endpoints:
31+
- "blazar:os_endpoint:{{ blazar_public_base_endpoint }}"
32+
- "{{ ('blazar_internal:os_endpoint:' + blazar_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
33+
enabled: "{{ enable_blazar | bool }}"
34+
- endpoints:
35+
- "ceph_rgw:http_2xx:{{ ceph_rgw_public_base_endpoint }}"
36+
- "{{ ('ceph_rgw_internal:http_2xx:' + ceph_rgw_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
37+
enabled: "{{ enable_ceph_rgw | bool }}"
38+
- endpoints:
39+
- "cinder:os_endpoint:{{ cinder_public_base_endpoint }}"
40+
- "{{ ('cinder_internal:os_endpoint:' + cinder_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
41+
enabled: "{{ enable_cinder | bool }}"
42+
- endpoints:
43+
- "cloudkitty:os_endpoint:{{ cloudkitty_public_endpoint }}"
44+
- "{{ ('cloudkitty_internal:os_endpoint:' + cloudkitty_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
45+
enabled: "{{ enable_cloudkitty | bool }}"
46+
- endpoints:
47+
- "designate:os_endpoint:{{ designate_public_endpoint }}"
48+
- "{{ ('designate_internal:os_endpoint:' + designate_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
49+
enabled: "{{ enable_designate | bool }}"
50+
- endpoints:
51+
- "glance:os_endpoint:{{ glance_public_endpoint }}"
52+
- "{{ ('glance_internal:os_endpoint:' + glance_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
53+
enabled: "{{ enable_glance | bool }}"
54+
- endpoints:
55+
- "gnocchi:os_endpoint:{{ gnocchi_public_endpoint }}"
56+
- "{{ ('gnocchi_internal:os_endpoint:' + gnocchi_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
57+
enabled: "{{ enable_gnocchi | bool }}"
58+
- endpoints:
59+
- "heat:os_endpoint:{{ heat_public_base_endpoint }}"
60+
- "{{ ('heat_internal:os_endpoint:' + heat_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
61+
- "heat_cfn:os_endpoint:{{ heat_cfn_public_base_endpoint }}"
62+
- "{{ ('heat_cfn_internal:os_endpoint:' + heat_cfn_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
63+
enabled: "{{ enable_heat | bool }}"
64+
- endpoints:
65+
- "horizon:http_2xx:{{ horizon_public_endpoint }}"
66+
- "{{ ('horizon_internal:http_2xx:' + horizon_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
67+
enabled: "{{ enable_horizon | bool }}"
68+
- endpoints:
69+
- "ironic:os_endpoint:{{ ironic_public_endpoint }}"
70+
- "{{ ('ironic_internal:os_endpoint:' + ironic_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
71+
- "ironic_inspector:os_endpoint:{{ ironic_inspector_public_endpoint }}"
72+
- "{{ ('ironic_inspector_internal:os_endpoint:' + ironic_inspector_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
73+
enabled: "{{ enable_ironic | bool }}"
74+
- endpoints:
75+
- "keystone:os_endpoint:{{ keystone_public_url }}"
76+
- "{{ ('keystone_internal:os_endpoint:' + keystone_internal_url) if not kolla_same_external_internal_vip | bool }}"
77+
enabled: "{{ enable_keystone | bool }}"
78+
- endpoints:
79+
- "magnum:os_endpoint:{{ magnum_public_base_endpoint }}"
80+
- "{{ ('magnum_internal:os_endpoint:' + magnum_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
81+
enabled: "{{ enable_magnum | bool }}"
82+
- endpoints:
83+
- "manila:os_endpoint:{{ manila_public_base_endpoint }}"
84+
- "{{ ('manila_internal:os_endpoint:' + manila_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
85+
enabled: "{{ enable_manila | bool }}"
86+
- endpoints:
87+
- "neutron:os_endpoint:{{ neutron_public_endpoint }}"
88+
- "{{ ('neutron_internal:os_endpoint:' + neutron_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
89+
enabled: "{{ enable_neutron | bool }}"
90+
- endpoints:
91+
- "nova:os_endpoint:{{ nova_public_base_endpoint }}"
92+
- "{{ ('nova_internal:os_endpoint:' + nova_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
93+
enabled: "{{ enable_nova | bool }}"
94+
- endpoints:
95+
- "octavia:os_endpoint:{{ octavia_public_endpoint }}"
96+
- "{{ ('octavia_internal:os_endpoint:' + octavia_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
97+
enabled: "{{ enable_octavia | bool }}"
98+
- endpoints:
99+
- "placement:os_endpoint:{{ placement_public_endpoint }}"
100+
- "{{ ('placement_internal:os_endpoint:' + placement_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
101+
enabled: "{{ enable_placement | bool }}"
102+
- endpoints:
103+
- "swift:os_endpoint:{{ swift_public_base_endpoint }}"
104+
- "{{ ('swift_internal:os_endpoint:' + swift_internal_base_endpoint) if not kolla_same_external_internal_vip | bool }}"
105+
enabled: "{{ enable_swift | bool }}"
106+
# Additional service endpoints
107+
- endpoints: "{% set etcd_endpoints = [] %}{% for host in groups.get('etcd', []) %}{{ etcd_endpoints.append('etcd_' + host + ':http_2xx:' + hostvars[host]['etcd_protocol'] + '://' + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['etcd_client_port'] + '/metrics')}}{% endfor %}{{ etcd_endpoints }}"
108+
enabled: "{{ enable_etcd | bool }}"
109+
- endpoints:
110+
- "grafana:http_2xx:{{ grafana_public_endpoint }}"
111+
- "{{ ('grafana_internal:http_2xx:' + grafana_internal_endpoint) if not kolla_same_external_internal_vip | bool }}"
112+
enabled: "{{ enable_grafana | bool }}"
113+
- endpoints:
114+
- "opensearch:http_2xx:{{ opensearch_internal_endpoint }}"
115+
enabled: "{{ enable_opensearch | bool }}"
116+
- endpoints:
117+
- "opensearch_dashboards_external:http_2xx_opensearch_dashboards:{{ opensearch_dashboards_external_endpoint }}/api/status"
118+
enabled: "{{ enable_opensearch_dashboards_external | bool }}"
119+
- endpoints:
120+
- "opensearch_dashboards:http_2xx_opensearch_dashboards:{{ opensearch_dashboards_internal_endpoint }}/api/status"
121+
enabled: "{{ enable_opensearch_dashboards | bool }}"
122+
- endpoints:
123+
- "prometheus:http_2xx_prometheus:{{ prometheus_public_endpoint if enable_prometheus_server_external else prometheus_internal_endpoint }}/-/healthy"
124+
enabled: "{{ enable_prometheus | bool }}"
125+
- endpoints:
126+
- "prometheus_alertmanager:http_2xx_alertmanager:{{ prometheus_alertmanager_public_endpoint if enable_prometheus_alertmanager_external else prometheus_alertmanager_internal_endpoint }}"
127+
enabled: "{{ enable_prometheus_alertmanager | bool }}"
128+
- endpoints: "{% set rabbitmq_endpoints = [] %}{% for host in groups.get('rabbitmq', []) %}{{ rabbitmq_endpoints.append('rabbitmq_' + host + (':tls_connect:' if rabbitmq_enable_tls else ':tcp_connect:') + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['rabbitmq_port'] ) }}{% endfor %}{{ rabbitmq_endpoints }}"
129+
enabled: "{{ enable_rabbitmq | bool }}"
130+
- endpoints: "{% set redis_endpoints = [] %}{% for host in groups.get('redis', []) %}{{ redis_endpoints.append('redis_' + host + ':tcp_connect:' + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['redis_port']) }}{% endfor %}{{ redis_endpoints }}"
131+
enabled: "{{ enable_redis | bool }}"
132+
133+
# Ensure service endpoints are defined
134+
blazar_internal_base_endpoint: "{{ blazar_internal_fqdn | kolla_url(internal_protocol, blazar_api_port) }}"
135+
blazar_public_base_endpoint: "{{ blazar_external_fqdn | kolla_url(public_protocol, blazar_api_public_port) }}"
136+
ceph_rgw_internal_base_endpoint: "{{ ceph_rgw_internal_fqdn | kolla_url(internal_protocol, ceph_rgw_port) }}"
137+
ceph_rgw_public_base_endpoint: "{{ ceph_rgw_external_fqdn | kolla_url(public_protocol, ceph_rgw_public_port) }}"
138+
cinder_internal_base_endpoint: "{{ cinder_internal_fqdn | kolla_url(internal_protocol, cinder_api_port) }}"
139+
cinder_public_base_endpoint: "{{ cinder_external_fqdn | kolla_url(public_protocol, cinder_api_public_port) }}"
140+
cloudkitty_internal_endpoint: "{{ cloudkitty_internal_fqdn | kolla_url(internal_protocol, cloudkitty_api_port) }}"
141+
cloudkitty_public_endpoint: "{{ cloudkitty_external_fqdn | kolla_url(public_protocol, cloudkitty_api_public_port) }}"
142+
gnocchi_internal_endpoint: "{{ gnocchi_internal_fqdn | kolla_url(internal_protocol, gnocchi_api_port) }}"
143+
gnocchi_public_endpoint: "{{ gnocchi_external_fqdn | kolla_url(public_protocol, gnocchi_api_public_port) }}"
144+
heat_internal_base_endpoint: "{{ heat_internal_fqdn | kolla_url(internal_protocol, heat_api_port) }}"
145+
heat_public_base_endpoint: "{{ heat_external_fqdn | kolla_url(public_protocol, heat_api_public_port) }}"
146+
heat_cfn_internal_base_endpoint: "{{ heat_cfn_internal_fqdn | kolla_url(internal_protocol, heat_api_cfn_port) }}"
147+
heat_cfn_public_base_endpoint: "{{ heat_cfn_external_fqdn | kolla_url(public_protocol, heat_api_cfn_public_port) }}"
148+
ironic_inspector_internal_endpoint: "{{ ironic_inspector_internal_fqdn | kolla_url(internal_protocol, ironic_inspector_port) }}"
149+
ironic_inspector_public_endpoint: "{{ ironic_inspector_external_fqdn | kolla_url(public_protocol, ironic_inspector_public_port) }}"
150+
magnum_internal_base_endpoint: "{{ magnum_internal_fqdn | kolla_url(internal_protocol, magnum_api_port) }}"
151+
magnum_public_base_endpoint: "{{ magnum_external_fqdn | kolla_url(public_protocol, magnum_api_public_port) }}"
152+
manila_internal_base_endpoint: "{{ manila_internal_fqdn | kolla_url(internal_protocol, manila_api_port) }}"
153+
manila_public_base_endpoint: "{{ manila_external_fqdn | kolla_url(public_protocol, manila_api_public_port) }}"
154+
nova_internal_base_endpoint: "{{ nova_internal_fqdn | kolla_url(internal_protocol, nova_api_port) }}"
155+
nova_public_base_endpoint: "{{ nova_external_fqdn | kolla_url(public_protocol, nova_api_public_port) }}"
156+
placement_internal_endpoint: "{{ placement_internal_fqdn | kolla_url(internal_protocol, placement_api_port) }}"
157+
placement_public_endpoint: "{{ placement_external_fqdn | kolla_url(public_protocol, placement_api_public_port) }}"
158+
swift_public_base_endpoint: "{{ swift_external_fqdn | kolla_url(public_protocol, swift_proxy_server_port) }}"
159+
opensearch_dashboards_internal_endpoint: "{{ opensearch_dashboards_internal_fqdn | default(kolla_internal_fqdn) | kolla_url(internal_protocol, opensearch_dashboards_port) }}"
160+
opensearch_dashboards_external_endpoint: "{{ opensearch_dashboards_external_fqdn | default(kolla_external_fqdn) | kolla_url(public_protocol, opensearch_dashboards_port_external) }}"
161+
prometheus_internal_endpoint: "{{ prometheus_internal_fqdn | kolla_url(internal_protocol, prometheus_port) }}"
162+
prometheus_public_endpoint: "{{ prometheus_external_fqdn | kolla_url(public_protocol, prometheus_public_port) }}"
163+
prometheus_alertmanager_internal_endpoint: "{{ prometheus_alertmanager_internal_fqdn | kolla_url(internal_protocol, prometheus_alertmanager_port) }}"
164+
prometheus_alertmanager_public_endpoint: "{{ prometheus_alertmanager_external_fqdn | kolla_url(public_protocol, prometheus_alertmanager_public_port) }}"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
features:
3+
- |
4+
Added a templated set of default Prometheus Blackbox exporter endpoints.

0 commit comments

Comments
 (0)