From c98c7a6eae39b7d23af291f6b014d0f8ed3e3cbc Mon Sep 17 00:00:00 2001 From: Manjeet Singh Bhatia Date: Wed, 2 Sep 2015 08:27:19 -0400 Subject: [PATCH] Change manager to master in docker-swarm This patch will replace use of manager with master in nova instances because as we will support more masters in future and master word is appropriate for nova instances. Change-Id: I543010796f0cac9bcfed8387656d801aea9dc13a Implements: blueprint manager-to-master --- .../docker-swarm/fragments/add-proxy.sh | 2 +- .../fragments/write-heat-params.yaml | 2 +- ...e.yaml => write-swarm-master-service.yaml} | 0 magnum/templates/docker-swarm/swarm.yaml | 58 ++++++++----------- magnum/templates/docker-swarm/swarmnode.yaml | 6 +- 5 files changed, 28 insertions(+), 40 deletions(-) rename magnum/templates/docker-swarm/fragments/{write-swarm-manager-service.yaml => write-swarm-master-service.yaml} (100%) diff --git a/magnum/templates/docker-swarm/fragments/add-proxy.sh b/magnum/templates/docker-swarm/fragments/add-proxy.sh index b66012ee86..edda41b69d 100644 --- a/magnum/templates/docker-swarm/fragments/add-proxy.sh +++ b/magnum/templates/docker-swarm/fragments/add-proxy.sh @@ -35,7 +35,7 @@ declare -x no_proxy=$NO_PROXY EOF else cat>> /etc/bashrc < This template will boot a Docker swarm cluster. A swarm cluster is made up - of a single manager node, and N agent nodes. Every node in the cluster, - including the manager, is running a Docker daemon and a swarm agent - advertising it to the cluster. The manager is running an addition swarm - manager container listening on port 2376. By default, the cluster is made - up of one manager node and one agent node. + of a single master node, and N agent nodes. Every node in the cluster, + including the master, is running a Docker daemon and a swarm agent + advertising it to the cluster. The master is running an addition swarm + master container listening on port 2376. By default, the cluster is made + up of one master node and one agent node. parameters: @@ -76,31 +76,19 @@ resources: master_wait_condition: type: "AWS::CloudFormation::WaitCondition" depends_on: - - swarm_manager + - swarm_master properties: Handle: get_resource: master_wait_handle Timeout: 6000 - manager_wait_handle: - type: "AWS::CloudFormation::WaitConditionHandle" - - manager_wait_condition: - type: "AWS::CloudFormation::WaitCondition" - depends_on: - - swarm_manager - properties: - Handle: - get_resource: manager_wait_handle - Timeout: 6000 - agent_wait_handle: type: "AWS::CloudFormation::WaitConditionHandle" agent_wait_condition: type: "AWS::CloudFormation::WaitCondition" depends_on: - - swarm_manager + - swarm_master properties: Handle: get_resource: agent_wait_handle @@ -182,7 +170,7 @@ resources: "$HTTP_PROXY": {get_param: http_proxy} "$HTTPS_PROXY": {get_param: https_proxy} "$NO_PROXY": {get_param: no_proxy} - "$NODE_IP": {get_attr: [swarm_manager_eth0, fixed_ips, 0, ip_address]} + "$NODE_IP": {get_attr: [swarm_master_eth0, fixed_ips, 0, ip_address]} remove_docker_key: type: "OS::Heat::SoftwareConfig" @@ -216,23 +204,23 @@ resources: str_replace: template: {get_file: fragments/write-swarm-agent-service.yaml} params: - "$NODE_IP": {get_attr: [swarm_manager_eth0, fixed_ips, 0, ip_address]} + "$NODE_IP": {get_attr: [swarm_master_eth0, fixed_ips, 0, ip_address]} "$DISCOVERY_URL": {get_param: discovery_url} "$WAIT_HANDLE": {get_resource: agent_wait_handle} "$HTTP_PROXY": {get_param: http_proxy} "$HTTPS_PROXY": {get_param: https_proxy} "$NO_PROXY": {get_param: no_proxy} - write_swarm_manager_service: + write_swarm_master_service: type: "OS::Heat::SoftwareConfig" properties: group: ungrouped config: str_replace: - template: {get_file: fragments/write-swarm-manager-service.yaml} + template: {get_file: fragments/write-swarm-master-service.yaml} params: "$DISCOVERY_URL": {get_param: discovery_url} - "$WAIT_HANDLE": {get_resource: manager_wait_handle} + "$WAIT_HANDLE": {get_resource: master_wait_handle} "$HTTP_PROXY": {get_param: http_proxy} "$HTTPS_PROXY": {get_param: https_proxy} "$NO_PROXY": {get_param: no_proxy} @@ -265,7 +253,7 @@ resources: group: ungrouped config: {get_file: fragments/add-proxy.sh} - swarm_manager_init: + swarm_master_init: type: "OS::Heat::MultipartMime" properties: parts: @@ -277,7 +265,7 @@ resources: - config: {get_resource: write_docker_socket} - config: {get_resource: write_docker_tcp_socket} - config: {get_resource: write_swarm_agent_service} - - config: {get_resource: write_swarm_manager_service} + - config: {get_resource: write_swarm_master_service} - config: {get_resource: enable_services} - config: {get_resource: cfn_signal} @@ -287,7 +275,7 @@ resources: # side the swarm agent. # - swarm_manager: + swarm_master: type: "OS::Nova::Server" depends_on: - extrouter_inside @@ -299,12 +287,12 @@ resources: key_name: get_param: ssh_key_name user_data_format: RAW - user_data: {get_resource: swarm_manager_init} + user_data: {get_resource: swarm_master_init} networks: - port: - get_resource: swarm_manager_eth0 + get_resource: swarm_master_eth0 - swarm_manager_eth0: + swarm_master_eth0: type: "OS::Neutron::Port" properties: network_id: @@ -315,7 +303,7 @@ resources: - subnet_id: get_resource: fixed_subnet - swarm_manager_floating: + swarm_master_floating: type: "OS::Neutron::FloatingIP" depends_on: - extrouter_inside @@ -323,7 +311,7 @@ resources: floating_network: get_param: external_network port_id: - get_resource: swarm_manager_eth0 + get_resource: swarm_master_eth0 swarm_nodes: type: "OS::Heat::ResourceGroup" @@ -344,12 +332,12 @@ resources: http_proxy: {get_param: http_proxy} https_proxy: {get_param: https_proxy} no_proxy: {get_param: no_proxy} - swarm_manager_ip: {get_attr: [swarm_manager_floating, floating_ip_address]} + swarm_master_ip: {get_attr: [swarm_master_floating, floating_ip_address]} outputs: - swarm_manager: - value: {get_attr: [swarm_manager_floating, floating_ip_address]} + swarm_master: + value: {get_attr: [swarm_master_floating, floating_ip_address]} swarm_nodes: value: {get_attr: [swarm_nodes, swarm_node_ip]} diff --git a/magnum/templates/docker-swarm/swarmnode.yaml b/magnum/templates/docker-swarm/swarmnode.yaml index cfa4ad35cd..45649f414c 100644 --- a/magnum/templates/docker-swarm/swarmnode.yaml +++ b/magnum/templates/docker-swarm/swarmnode.yaml @@ -53,9 +53,9 @@ parameters: description: no proxies for docker default: "" - swarm_manager_ip: + swarm_master_ip: type: string - description: swarm manager's ip address + description: swarm master's ip address resources: @@ -118,7 +118,7 @@ resources: "$HTTP_PROXY": {get_param: http_proxy} "$HTTPS_PROXY": {get_param: https_proxy} "$NO_PROXY": {get_param: no_proxy} - "$SWARM_MANAGER_IP": {get_param: swarm_manager_ip} + "$SWARM_MASTER_IP": {get_param: swarm_master_ip} "$NODE_IP": {get_attr: [swarm_node_eth0, fixed_ips, 0, ip_address]} remove_docker_key: