Allow aodh services to use independent hostnames

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

* aodh_internal_fqdn
* aodh_external_fqdn

These default to the old values of kolla_internal_fqdn or
kolla_external_fqdn.

This also adds a aodh_api_listen_port option, which defaults to
aodh_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: Iee08b725d066bfbe543d9319c47941d59c22212a
Implements: blueprint service-hostnames
This commit is contained in:
Jim Rollenhagen 2018-12-27 15:41:39 -05:00
parent d0fc1ec278
commit 1ebb1ccee2
5 changed files with 12 additions and 7 deletions

View File

@ -184,7 +184,10 @@ neutron_ipam_driver: "internal"
# The default ports used by each service. # The default ports used by each service.
# The list should be in alphabetical order # The list should be in alphabetical order
aodh_internal_fqdn: "{{ kolla_internal_fqdn }}"
aodh_external_fqdn: "{{ kolla_external_fqdn }}"
aodh_api_port: "8042" aodh_api_port: "8042"
aodh_api_listen_port: "{{ aodh_api_port }}"
barbican_internal_fqdn: "{{ kolla_internal_fqdn }}" barbican_internal_fqdn: "{{ kolla_internal_fqdn }}"
barbican_external_fqdn: "{{ kolla_external_fqdn }}" barbican_external_fqdn: "{{ kolla_external_fqdn }}"

View File

@ -20,11 +20,13 @@ aodh_services:
mode: "http" mode: "http"
external: false external: false
port: "{{ aodh_api_port }}" port: "{{ aodh_api_port }}"
listen_port: "{{ aodh_api_listen_port }}"
aodh_api_external: aodh_api_external:
enabled: "{{ enable_aodh }}" enabled: "{{ enable_aodh }}"
mode: "http" mode: "http"
external: true external: true
port: "{{ aodh_api_port }}" port: "{{ aodh_api_port }}"
listen_port: "{{ aodh_api_listen_port }}"
aodh-evaluator: aodh-evaluator:
container_name: aodh_evaluator container_name: aodh_evaluator
group: aodh-evaluator group: aodh-evaluator
@ -116,9 +118,9 @@ aodh_notifier_dimensions: "{{ default_container_dimensions }}"
#################### ####################
# OpenStack # OpenStack
#################### ####################
aodh_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ aodh_api_port }}" aodh_admin_endpoint: "{{ admin_protocol }}://{{ aodh_internal_fqdn }}:{{ aodh_api_port }}"
aodh_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ aodh_api_port }}" aodh_internal_endpoint: "{{ internal_protocol }}://{{ aodh_internal_fqdn }}:{{ aodh_api_port }}"
aodh_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ aodh_api_port }}" aodh_public_endpoint: "{{ public_protocol }}://{{ aodh_external_fqdn }}:{{ aodh_api_port }}"
aodh_logging_debug: "{{ openstack_logging_debug }}" aodh_logging_debug: "{{ openstack_logging_debug }}"

View File

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

View File

@ -7,7 +7,7 @@ evaluation_interval = {{ aodh_evaluation_interval }}
transport_url = {{ rpc_transport_url }} transport_url = {{ rpc_transport_url }}
[api] [api]
port = {{ aodh_api_port }} port = {{ aodh_api_listen_port }}
host = {{ api_interface_address }} host = {{ api_interface_address }}
[database] [database]

View File

@ -1,6 +1,6 @@
{% set python_path = '/usr/lib/python2.7/site-packages' if aodh_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} {% set python_path = '/usr/lib/python2.7/site-packages' if aodh_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %}
{% set binary_path = '/usr/bin' if aodh_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% set binary_path = '/usr/bin' if aodh_install_type == 'binary' else '/var/lib/kolla/venv/bin' %}
Listen {{ api_interface_address }}:{{ aodh_api_port }} Listen {{ api_interface_address }}:{{ aodh_api_listen_port }}
ServerSignature Off ServerSignature Off
ServerTokens Prod ServerTokens Prod
@ -14,7 +14,7 @@ TraceEnable off
</FilesMatch> </FilesMatch>
</Directory> </Directory>
<VirtualHost *:{{ aodh_api_port }}> <VirtualHost *:{{ aodh_api_listen_port }}>
## Logging ## Logging
ErrorLog "/var/log/kolla/aodh/aodh_wsgi_error.log" ErrorLog "/var/log/kolla/aodh/aodh_wsgi_error.log"
ServerSignature Off ServerSignature Off