Merge "Support using internal network for clients"

This commit is contained in:
Jenkins 2016-04-06 13:02:03 +00:00 committed by Gerrit Code Review
commit 03c3d96765
6 changed files with 42 additions and 1 deletions

View File

@ -142,6 +142,13 @@ options:
default: RegionOne
type: string
description: OpenStack Region
use-internal-endpoints:
default: False
type: boolean
description: |
Openstack mostly defaults to using public endpoints for
internal communication between services. If set to True this option will
configure services to use internal endpoints where possible.
glance-api-version:
default: 1
type: int

View File

@ -1479,3 +1479,15 @@ class NetworkServiceContext(OSContextGenerator):
if self.context_complete(ctxt):
return ctxt
return {}
class InternalEndpointContext(OSContextGenerator):
"""Internal endpoint context.
This context provides the endpoint type used for communication between
services e.g. between Nova and Cinder internally. Openstack uses Public
endpoints by default so this allows admins to optionally use internal
endpoints.
"""
def __call__(self):
return {'use_internal_endpoints': config('use-internal-endpoints')}

View File

@ -209,7 +209,8 @@ BASE_RESOURCE_MAP = OrderedDict([
service_user='cinder'),
context.BindHostContext(),
context.WorkerConfigContext(),
cinder_contexts.RegionContext()],
cinder_contexts.RegionContext(),
context.InternalEndpointContext()],
'services': ['cinder-api', 'cinder-volume', 'cinder-scheduler',
'haproxy']
}),

View File

@ -29,6 +29,13 @@ control_exchange = cinder
volume_driver = {{ volume_driver }}
{% endif -%}
{% if use_internal_endpoints -%}
swift_catalog_info = object-store:swift:internalURL
keystone_catalog_info = identity:Identity Service:internalURL
glance_catalog_info = image:glance:internalURL
nova_catalog_info = compute:Compute Service:internalURL
{% endif %}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
host = {{ host }}

View File

@ -26,6 +26,13 @@ control_exchange = cinder
volume_driver = {{ volume_driver }}
{% endif -%}
{% if use_internal_endpoints -%}
swift_catalog_info = object-store:swift:internalURL
keystone_catalog_info = identity:Identity Service:internalURL
glance_catalog_info = image:glance:internalURL
nova_catalog_info = compute:Compute Service:internalURL
{% endif %}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
host = {{ host }}

View File

@ -26,6 +26,13 @@ control_exchange = cinder
volume_driver = {{ volume_driver }}
{% endif -%}
{% if use_internal_endpoints -%}
swift_catalog_info = object-store:swift:internalURL
keystone_catalog_info = identity:Identity Service:internalURL
glance_catalog_info = image:glance:internalURL
nova_catalog_info = compute:Compute Service:internalURL
{% endif %}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
host = {{ host }}