From bc4017ba64099f2e7e4c58754b01240d6227a316 Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 5 Sep 2017 11:52:39 +0100 Subject: [PATCH] Add support for use-internal-endpoints Add support for use of internal endpoints for inter-service API calls from heat. Change-Id: I4a9399e84f3a6ad90a935f12407b4365f35841cb Closes-Bug: 1713923 --- config.yaml | 7 +++++++ hooks/heat_utils.py | 1 + templates/icehouse/heat.conf | 5 +++++ templates/kilo/heat.conf | 4 ++++ templates/liberty/heat.conf | 4 ++++ templates/mitaka/heat.conf | 4 ++++ 6 files changed, 25 insertions(+) diff --git a/config.yaml b/config.yaml index d520c7e..e76853e 100644 --- a/config.yaml +++ b/config.yaml @@ -247,3 +247,10 @@ options: description: | Default multicast port number that will be used to communicate between HA Cluster nodes. + use-internal-endpoints: + type: boolean + default: False + 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. diff --git a/hooks/heat_utils.py b/hooks/heat_utils.py index ebcaab1..326ea46 100644 --- a/hooks/heat_utils.py +++ b/hooks/heat_utils.py @@ -103,6 +103,7 @@ CONFIG_FILES = OrderedDict([ context.SharedDBContext(relation_prefix='heat', ssl_dir=HEAT_DIR), context.OSConfigFlagContext(), + context.InternalEndpointContext(), HeatIdentityServiceContext(service=SVC, service_user=SVC), HeatHAProxyContext(), HeatSecurityContext(), diff --git a/templates/icehouse/heat.conf b/templates/icehouse/heat.conf index 84eb105..e0b7361 100644 --- a/templates/icehouse/heat.conf +++ b/templates/icehouse/heat.conf @@ -85,3 +85,8 @@ bind_port={{ api_cfn_listen_port }} bind_port=8000 {% endif %} workers = {{ workers }} + +{% if use_internal_endpoints -%} +[clients] +endpoint_type = internalURL +{%- endif %} diff --git a/templates/kilo/heat.conf b/templates/kilo/heat.conf index 0b1a04d..7557aa4 100644 --- a/templates/kilo/heat.conf +++ b/templates/kilo/heat.conf @@ -62,3 +62,7 @@ workers = {{ workers }} {% include "section-rabbitmq-oslo" %} +{% if use_internal_endpoints -%} +[clients] +endpoint_type = internalURL +{%- endif %} diff --git a/templates/liberty/heat.conf b/templates/liberty/heat.conf index 9147b5f..78b57e4 100644 --- a/templates/liberty/heat.conf +++ b/templates/liberty/heat.conf @@ -75,3 +75,7 @@ workers = {{ workers }} {% include "section-rabbitmq-oslo" %} +{% if use_internal_endpoints -%} +[clients] +endpoint_type = internalURL +{%- endif %} diff --git a/templates/mitaka/heat.conf b/templates/mitaka/heat.conf index 5d13953..c6543d9 100644 --- a/templates/mitaka/heat.conf +++ b/templates/mitaka/heat.conf @@ -66,3 +66,7 @@ workers = {{ workers }} {% include "section-rabbitmq-oslo" %} +{% if use_internal_endpoints -%} +[clients] +endpoint_type = internalURL +{%- endif %}