Allow glance services to use independent hostnames

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

* glance_internal_fqdn
* glance_external_fqdn

These default to the old values of kolla_internal_fqdn or
kolla_external_fqdn.

This also adds a glance_api_listen_port option, which defaults to
glance_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: Icb91f728533e2db1908b23dabb0501cf9f8a2b75
Implements: blueprint service-hostnames
This commit is contained in:
Jim Rollenhagen 2018-12-18 10:39:22 -05:00
parent 51c9e1b633
commit a819ef1215
8 changed files with 15 additions and 11 deletions

View File

@ -211,7 +211,10 @@ fluentd_syslog_port: "5140"
freezer_api_port: "9090"
glance_internal_fqdn: "{{ kolla_internal_fqdn }}"
glance_external_fqdn: "{{ kolla_external_fqdn }}"
glance_api_port: "9292"
glance_api_listen_port: "{{ glance_api_port }}"
gnocchi_api_port: "8041"

View File

@ -13,7 +13,7 @@ my_ip = {{ api_interface_address }}
osapi_volume_workers = {{ openstack_service_workers }}
volume_name_template = volume-%s
glance_api_servers = {{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ glance_api_port }}
glance_api_servers = {{ internal_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}
glance_num_retries = {{ groups['glance-api'] | length }}
glance_api_version = 2

View File

@ -41,7 +41,7 @@ glance_services:
####################
# HAProxy
####################
haproxy_members: "{% for host in glance_api_hosts %}server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_port }} check inter 2000 rise 2 fall 5;{% endfor %}"
haproxy_members: "{% for host in glance_api_hosts %}server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_listen_port }} check inter 2000 rise 2 fall 5;{% endfor %}"
####################
# Notification
@ -125,9 +125,10 @@ glance_store_backends: "{{ glance_backends|selectattr('enabled', 'equalto', true
####################
# OpenStack
####################
glance_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ glance_api_port }}"
glance_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ glance_api_port }}"
glance_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ glance_api_port }}"
glance_admin_endpoint: "{{ admin_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}"
glance_internal_endpoint: "{{ internal_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}"
glance_public_endpoint: "{{ public_protocol }}://{{ glance_external_fqdn }}:{{ glance_api_port }}"
glance_logging_debug: "{{ openstack_logging_debug }}"

View File

@ -7,7 +7,7 @@
- name: Checking free port for Glance API
wait_for:
host: "{{ api_interface_address }}"
port: "{{ glance_api_port }}"
port: "{{ glance_api_listen_port }}"
connect_timeout: 1
timeout: 1
state: stopped

View File

@ -6,10 +6,10 @@ log_file = /var/log/kolla/glance/glance-api.log
use_forwarded_for = true
bind_host = {{ api_interface_address }}
bind_port = {{ glance_api_port }}
bind_port = {{ glance_api_listen_port }}
workers = {{ openstack_service_workers }}
registry_host = {{ kolla_internal_fqdn }}
registry_host = {{ glance_internal_fqdn }}
{% if glance_backend_ceph | bool %}
show_multiple_locations = True

View File

@ -72,7 +72,7 @@ password = {{ ironic_keystone_password }}
{% endif %}
[glance]
glance_api_servers = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ glance_api_port }}
glance_api_servers = {{ internal_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}
auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default

View File

@ -31,7 +31,7 @@ user_domain_name = {{ default_user_domain_name }}
os_region_name = {{ openstack_region_name }}
[glance]
api_servers = {{ internal_protocol }}://{% for host in groups['glance-api'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_port }}{% if not loop.last %},{% endif %}{% endfor %}
api_servers = {{ internal_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}
[hyperv]

View File

@ -128,7 +128,7 @@ enable_proxy_headers_parsing = True
lock_path = /var/lib/nova/tmp
[glance]
api_servers = {{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ glance_api_port }}
api_servers = {{ internal_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}
num_retries = {{ groups['glance-api'] | length }}