Allow gnocchi services to use independent hostnames

This allows gnocchi service endpoints to use custom hostnames, and adds the
following variables:

* gnocchi_internal_fqdn
* gnocchi_external_fqdn

These default to the old values of kolla_internal_fqdn or
kolla_external_fqdn.

This also adds a gnocchi_api_listen_port option, which defaults to
gnocchi_api_port for backward compatibility.

This option allow the user to differentiate between the port the
service listens on, and the port the service is reachable on. This is
useful for external load balancers which live on the same host as the
service itself.

Change-Id: Ic9a0f8130b19ed77987f45fd0e824b82ea7a7328
Implements: blueprint service-hostnames
This commit is contained in:
Jim Rollenhagen 2018-12-27 15:45:03 -05:00
parent 1ebb1ccee2
commit f8a1a716ac
5 changed files with 12 additions and 9 deletions

View File

@ -229,7 +229,10 @@ glance_external_fqdn: "{{ kolla_external_fqdn }}"
glance_api_port: "9292"
glance_api_listen_port: "{{ glance_api_port }}"
gnocchi_internal_fqdn: "{{ kolla_internal_fqdn }}"
gnocchi_external_fqdn: "{{ kolla_external_fqdn }}"
gnocchi_api_port: "8041"
gnocchi_api_listen_port: "{{ gnocchi_api_port }}"
grafana_server_port: "3000"

View File

@ -18,12 +18,12 @@ gnocchi_services:
enabled: "{{ enable_gnocchi }}"
mode: "http"
external: false
port: "{{ gnocchi_api_port }}"
port: "{{ gnocchi_api_listen_port }}"
gnocchi_api_external:
enabled: "{{ enable_gnocchi }}"
mode: "http"
external: true
port: "{{ gnocchi_api_port }}"
port: "{{ gnocchi_api_listen_port }}"
gnocchi-metricd:
container_name: gnocchi_metricd
group: gnocchi-metricd
@ -110,9 +110,9 @@ gnocchi_statsd_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack
####################
gnocchi_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_admin_endpoint: "{{ admin_protocol }}://{{ gnocchi_internal_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_internal_endpoint: "{{ internal_protocol }}://{{ gnocchi_internal_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_public_endpoint: "{{ public_protocol }}://{{ gnocchi_external_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_logging_debug: "{{ openstack_logging_debug }}"

View File

@ -8,7 +8,7 @@
- name: Checking free port for Gnocchi API
wait_for:
host: "{{ api_interface_address }}"
port: "{{ gnocchi_api_port }}"
port: "{{ gnocchi_api_listen_port }}"
connect_timeout: 1
timeout: 1
state: stopped

View File

@ -13,7 +13,7 @@ log_file = /var/log/kolla/gnocchi/gnocchi-api.log
{% endif %}
[api]
port = {{ gnocchi_api_port }}
port = {{ gnocchi_api_listen_port }}
host = {{ api_interface_address }}
middlewares = keystonemiddleware.auth_token.AuthProtocol
auth_mode = keystone

View File

@ -1,12 +1,12 @@
{% set python_path = '/usr/lib/python2.7/site-packages' if gnocchi_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %}
{% set wsgi_path = '/usr/bin' if gnocchi_install_type == 'binary' else '/var/lib/kolla/venv/bin' %}
Listen {{ api_interface_address }}:{{ gnocchi_api_port }}
Listen {{ api_interface_address }}:{{ gnocchi_api_listen_port }}
ServerSignature Off
ServerTokens Prod
TraceEnable off
<VirtualHost *:{{ gnocchi_api_port }}>
<VirtualHost *:{{ gnocchi_api_listen_port }}>
ErrorLog "/var/log/kolla/gnocchi/gnocchi-api-error.log"
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat