Allow swift proxy server to use independent hostnames

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

* swift_internal_fqdn
* swift_external_fqdn

These default to the old values of kolla_internal_fqdn or
kolla_external_fqdn.

This also adds a swift_proxy_server_listen_port option, which defaults to
swift_proxy_server_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.

While we're in here, use the ``internal_protocol`` variable for the swift
endpoint in cinder's swift backup driver configuration, instead of hardcoding
to ``http``.

Change-Id: Ibc01618383c26e16c0067f7f6b9cf5160d968d1e
Implements: blueprint service-hostnames
This commit is contained in:
Jim Rollenhagen 2018-12-27 14:41:53 -05:00
parent b6c31862af
commit 31ed556e67
5 changed files with 11 additions and 8 deletions

View File

@ -380,7 +380,10 @@ storm_worker_port_range:
start: 6700
end: 6703
swift_internal_fqdn: "{{ kolla_internal_fqdn }}"
swift_external_fqdn: "{{ kolla_external_fqdn }}"
swift_proxy_server_port: "8080"
swift_proxy_server_listen_port: "{{ swift_proxy_server_port }}"
swift_object_server_port: "6000"
swift_account_server_port: "6001"
swift_container_server_port: "6002"

View File

@ -42,7 +42,7 @@ backup_share = {{ cinder_backup_share }}
backup_file_size = 327680000
{% elif enable_swift | bool and cinder_backup_driver == "swift" %}
backup_driver = cinder.backup.drivers.swift.SwiftBackupDriver
backup_swift_url = http://{{ kolla_internal_vip_address }}:{{ swift_proxy_server_port }}/v1/AUTH_
backup_swift_url = {{ internal_protocol }}://{{ swift_internal_fqdn }}:{{ swift_proxy_server_port }}/v1/AUTH_
backup_swift_auth = per_user
backup_swift_auth_version = 1
backup_swift_user =

View File

@ -10,12 +10,12 @@ swift_services:
enabled: "{{ enable_swift }}"
mode: "http"
external: false
port: "{{ swift_proxy_server_port }}"
port: "{{ swift_proxy_server_listen_port }}"
swift_api_external:
enabled: "{{ enable_swift }}"
mode: "http"
external: true
port: "{{ swift_proxy_server_port }}"
port: "{{ swift_proxy_server_listen_port }}"
####################
# Docker
@ -52,9 +52,9 @@ swift_log_level: "{{ 'INFO' if openstack_logging_debug == 'False' else 'DEBUG'}}
####################
# OpenStack
####################
swift_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ swift_proxy_server_port }}/v1"
swift_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s"
swift_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s"
swift_admin_endpoint: "{{ admin_protocol }}://{{ swift_internal_fqdn }}:{{ swift_proxy_server_port }}/v1"
swift_internal_endpoint: "{{ internal_protocol }}://{{ swift_internal_fqdn }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s"
swift_public_endpoint: "{{ public_protocol }}://{{ swift_external_fqdn }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s"
swift_logging_debug: "{{ openstack_logging_debug }}"

View File

@ -55,7 +55,7 @@
- name: Checking free port for Swift Proxy Server
wait_for:
host: "{{ api_interface_address }}"
port: "{{ swift_proxy_server_port }}"
port: "{{ swift_proxy_server_listen_port }}"
connect_timeout: 1
timeout: 1
state: stopped

View File

@ -1,6 +1,6 @@
[DEFAULT]
bind_ip = {{ api_interface_address }}
bind_port = {{ swift_proxy_server_port }}
bind_port = {{ swift_proxy_server_listen_port }}
log_udp_host = {{ syslog_server }}
log_udp_port = {{ syslog_udp_port }}