From 1d5d38b6aee98e2c33379f7fe6c7032febd38536 Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Wed, 23 Nov 2016 06:14:39 +0000 Subject: [PATCH] Add heat-api-cfn service Add heat-api-cfn service, which is used by Heat for some config transports. It's necessary to support default user_data_format (HEAT_CFNTOOLS). This change add new image heat-api-cfn and which will create new service and necessary endpoints for it. Two new options were added: - heat_waitcondition_server_url - heat_metadata_server_url Change-Id: I725943f5034637554394c4a323d4dc9134b3ddb3 --- docker/heat-api-cfn/Dockerfile.j2 | 4 +++ service/files/defaults.yaml | 3 ++ service/files/heat.conf.j2 | 8 +++++ service/heat-api-cfn.yaml | 51 +++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 docker/heat-api-cfn/Dockerfile.j2 create mode 100644 service/heat-api-cfn.yaml diff --git a/docker/heat-api-cfn/Dockerfile.j2 b/docker/heat-api-cfn/Dockerfile.j2 new file mode 100644 index 0000000..172a070 --- /dev/null +++ b/docker/heat-api-cfn/Dockerfile.j2 @@ -0,0 +1,4 @@ +FROM {{ image_spec("heat-base") }} +MAINTAINER {{ maintainer }} + +USER heat diff --git a/service/files/defaults.yaml b/service/files/defaults.yaml index e69b042..3332e55 100644 --- a/service/files/defaults.yaml +++ b/service/files/defaults.yaml @@ -3,6 +3,9 @@ configs: api_port: cont: 8004 ingress: orchestration + api_cfn_port: + cont: 8000 + ingress: cloudformation db: username: heat password: password diff --git a/service/files/heat.conf.j2 b/service/files/heat.conf.j2 index 5a5f07c..fd810bc 100644 --- a/service/files/heat.conf.j2 +++ b/service/files/heat.conf.j2 @@ -8,6 +8,9 @@ rpc_backend = rabbit stack_domain_admin = {{ heat.domain.user }} stack_domain_admin_password = {{ heat.domain.password }} stack_user_domain_name = {{ heat.domain.name }} +heat_waitcondition_server_url = {{ address('heat-api-cfn', heat.api_cfn_port, external=True, with_scheme=True) }}/v1/waitcondition +heat_metadata_server_url = {{ address('heat-api-cfn', heat.api_cfn_port, external=True, with_scheme=True) }} + [clients] endpoint_type = internalURL @@ -48,6 +51,11 @@ auth_uri = {{ address('keystone', keystone.public_port, with_scheme=True) }} bind_host = {{ network_topology["private"]["address"] }} bind_port = {{ heat.api_port.cont }} +[heat_api_cfn] +bind_host = {{ network_topology["private"]["address"] }} +bind_port = {{ heat.api_cfn_port.cont }} + + [cache] backend = oslo_cache.memcache_pool enabled = True diff --git a/service/heat-api-cfn.yaml b/service/heat-api-cfn.yaml new file mode 100644 index 0000000..209b927 --- /dev/null +++ b/service/heat-api-cfn.yaml @@ -0,0 +1,51 @@ +dsl_version: 0.1.0 +service: + name: heat-api-cfn + ports: + - {{ heat.api_cfn_port }} + containers: + - name: heat-api-cfn + image: heat-api-cfn + probes: + readiness: "true" + liveness: + command: "true" + type: "exec" + pre: + - name: heat-cfn-service-create + dependencies: + - keystone-create-project + type: single + command: + openstack service create --name heat-cfn --description "Heat CloudFormation Service" cloudformation + - name: heat-cfn-public-endpoint-create + dependencies: + - heat-cfn-service-create + type: single + command: + openstack endpoint create --region RegionOne cloudformation public {{ address('heat-api-cfn', heat.api_cfn_port, external=True, with_scheme=True) }}/v1 + - name: heat-cfn-internal-endpoint-create + dependencies: + - heat-cfn-service-create + type: single + command: + openstack endpoint create --region RegionOne cloudformation internal {{ address('heat-api-cfn', heat.api_cfn_port, with_scheme=True) }}/v1 + - name: heat-cfn-admin-endpoint-create + dependencies: + - heat-cfn-service-create + type: single + command: + openstack endpoint create --region RegionOne cloudformation admin {{ address('heat-api-cfn', heat.api_cfn_port, with_scheme=True) }}/v1 + daemon: + dependencies: + - rabbitmq + # heat-api in dependencies, because it prepares DB, which will be used + - heat-api + files: + - heat-conf + command: heat-api-cfn --config-file /etc/heat/heat.conf + +files: + heat-conf: + path: /etc/heat/heat.conf + content: heat.conf.j2