Merge "Change manager to master in docker-swarm"
This commit is contained in:
commit
7ed30d1989
|
@ -35,7 +35,7 @@ declare -x no_proxy=$NO_PROXY
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
cat>> /etc/bashrc <<EOF
|
cat>> /etc/bashrc <<EOF
|
||||||
declare -x no_proxy=$SWARM_MANAGER_IP,$SWARM_NODE_IP
|
declare -x no_proxy=$SWARM_MASTER_IP,$SWARM_NODE_IP
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
@ -10,5 +10,5 @@ write_files:
|
||||||
HTTPS_PROXY="$HTTPS_PROXY"
|
HTTPS_PROXY="$HTTPS_PROXY"
|
||||||
NO_PROXY="$NO_PROXY"
|
NO_PROXY="$NO_PROXY"
|
||||||
FIXED_NETWORK_CIDR="$FIXED_NETWORK_CIDR"
|
FIXED_NETWORK_CIDR="$FIXED_NETWORK_CIDR"
|
||||||
SWARM_MANAGER_IP="$SWARM_MANAGER_IP"
|
SWARM_MASTER_IP="$SWARM_MASTER_IP"
|
||||||
SWARM_NODE_IP="$NODE_IP"
|
SWARM_NODE_IP="$NODE_IP"
|
||||||
|
|
|
@ -2,11 +2,11 @@ heat_template_version: 2013-05-23
|
||||||
|
|
||||||
description: >
|
description: >
|
||||||
This template will boot a Docker swarm cluster. A swarm cluster is made up
|
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,
|
of a single master node, and N agent nodes. Every node in the cluster,
|
||||||
including the manager, is running a Docker daemon and a swarm agent
|
including the master, is running a Docker daemon and a swarm agent
|
||||||
advertising it to the cluster. The manager is running an addition swarm
|
advertising it to the cluster. The master is running an addition swarm
|
||||||
manager container listening on port 2376. By default, the cluster is made
|
master container listening on port 2376. By default, the cluster is made
|
||||||
up of one manager node and one agent node.
|
up of one master node and one agent node.
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
|
|
||||||
|
@ -76,31 +76,19 @@ resources:
|
||||||
master_wait_condition:
|
master_wait_condition:
|
||||||
type: "AWS::CloudFormation::WaitCondition"
|
type: "AWS::CloudFormation::WaitCondition"
|
||||||
depends_on:
|
depends_on:
|
||||||
- swarm_manager
|
- swarm_master
|
||||||
properties:
|
properties:
|
||||||
Handle:
|
Handle:
|
||||||
get_resource: master_wait_handle
|
get_resource: master_wait_handle
|
||||||
Timeout: 6000
|
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:
|
agent_wait_handle:
|
||||||
type: "AWS::CloudFormation::WaitConditionHandle"
|
type: "AWS::CloudFormation::WaitConditionHandle"
|
||||||
|
|
||||||
agent_wait_condition:
|
agent_wait_condition:
|
||||||
type: "AWS::CloudFormation::WaitCondition"
|
type: "AWS::CloudFormation::WaitCondition"
|
||||||
depends_on:
|
depends_on:
|
||||||
- swarm_manager
|
- swarm_master
|
||||||
properties:
|
properties:
|
||||||
Handle:
|
Handle:
|
||||||
get_resource: agent_wait_handle
|
get_resource: agent_wait_handle
|
||||||
|
@ -182,7 +170,7 @@ resources:
|
||||||
"$HTTP_PROXY": {get_param: http_proxy}
|
"$HTTP_PROXY": {get_param: http_proxy}
|
||||||
"$HTTPS_PROXY": {get_param: https_proxy}
|
"$HTTPS_PROXY": {get_param: https_proxy}
|
||||||
"$NO_PROXY": {get_param: no_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:
|
remove_docker_key:
|
||||||
type: "OS::Heat::SoftwareConfig"
|
type: "OS::Heat::SoftwareConfig"
|
||||||
|
@ -216,23 +204,23 @@ resources:
|
||||||
str_replace:
|
str_replace:
|
||||||
template: {get_file: fragments/write-swarm-agent-service.yaml}
|
template: {get_file: fragments/write-swarm-agent-service.yaml}
|
||||||
params:
|
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}
|
"$DISCOVERY_URL": {get_param: discovery_url}
|
||||||
"$WAIT_HANDLE": {get_resource: agent_wait_handle}
|
"$WAIT_HANDLE": {get_resource: agent_wait_handle}
|
||||||
"$HTTP_PROXY": {get_param: http_proxy}
|
"$HTTP_PROXY": {get_param: http_proxy}
|
||||||
"$HTTPS_PROXY": {get_param: https_proxy}
|
"$HTTPS_PROXY": {get_param: https_proxy}
|
||||||
"$NO_PROXY": {get_param: no_proxy}
|
"$NO_PROXY": {get_param: no_proxy}
|
||||||
|
|
||||||
write_swarm_manager_service:
|
write_swarm_master_service:
|
||||||
type: "OS::Heat::SoftwareConfig"
|
type: "OS::Heat::SoftwareConfig"
|
||||||
properties:
|
properties:
|
||||||
group: ungrouped
|
group: ungrouped
|
||||||
config:
|
config:
|
||||||
str_replace:
|
str_replace:
|
||||||
template: {get_file: fragments/write-swarm-manager-service.yaml}
|
template: {get_file: fragments/write-swarm-master-service.yaml}
|
||||||
params:
|
params:
|
||||||
"$DISCOVERY_URL": {get_param: discovery_url}
|
"$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}
|
"$HTTP_PROXY": {get_param: http_proxy}
|
||||||
"$HTTPS_PROXY": {get_param: https_proxy}
|
"$HTTPS_PROXY": {get_param: https_proxy}
|
||||||
"$NO_PROXY": {get_param: no_proxy}
|
"$NO_PROXY": {get_param: no_proxy}
|
||||||
|
@ -265,7 +253,7 @@ resources:
|
||||||
group: ungrouped
|
group: ungrouped
|
||||||
config: {get_file: fragments/add-proxy.sh}
|
config: {get_file: fragments/add-proxy.sh}
|
||||||
|
|
||||||
swarm_manager_init:
|
swarm_master_init:
|
||||||
type: "OS::Heat::MultipartMime"
|
type: "OS::Heat::MultipartMime"
|
||||||
properties:
|
properties:
|
||||||
parts:
|
parts:
|
||||||
|
@ -277,7 +265,7 @@ resources:
|
||||||
- config: {get_resource: write_docker_socket}
|
- config: {get_resource: write_docker_socket}
|
||||||
- config: {get_resource: write_docker_tcp_socket}
|
- config: {get_resource: write_docker_tcp_socket}
|
||||||
- config: {get_resource: write_swarm_agent_service}
|
- 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: enable_services}
|
||||||
- config: {get_resource: cfn_signal}
|
- config: {get_resource: cfn_signal}
|
||||||
|
|
||||||
|
@ -287,7 +275,7 @@ resources:
|
||||||
# side the swarm agent.
|
# side the swarm agent.
|
||||||
#
|
#
|
||||||
|
|
||||||
swarm_manager:
|
swarm_master:
|
||||||
type: "OS::Nova::Server"
|
type: "OS::Nova::Server"
|
||||||
depends_on:
|
depends_on:
|
||||||
- extrouter_inside
|
- extrouter_inside
|
||||||
|
@ -299,12 +287,12 @@ resources:
|
||||||
key_name:
|
key_name:
|
||||||
get_param: ssh_key_name
|
get_param: ssh_key_name
|
||||||
user_data_format: RAW
|
user_data_format: RAW
|
||||||
user_data: {get_resource: swarm_manager_init}
|
user_data: {get_resource: swarm_master_init}
|
||||||
networks:
|
networks:
|
||||||
- port:
|
- port:
|
||||||
get_resource: swarm_manager_eth0
|
get_resource: swarm_master_eth0
|
||||||
|
|
||||||
swarm_manager_eth0:
|
swarm_master_eth0:
|
||||||
type: "OS::Neutron::Port"
|
type: "OS::Neutron::Port"
|
||||||
properties:
|
properties:
|
||||||
network_id:
|
network_id:
|
||||||
|
@ -315,7 +303,7 @@ resources:
|
||||||
- subnet_id:
|
- subnet_id:
|
||||||
get_resource: fixed_subnet
|
get_resource: fixed_subnet
|
||||||
|
|
||||||
swarm_manager_floating:
|
swarm_master_floating:
|
||||||
type: "OS::Neutron::FloatingIP"
|
type: "OS::Neutron::FloatingIP"
|
||||||
depends_on:
|
depends_on:
|
||||||
- extrouter_inside
|
- extrouter_inside
|
||||||
|
@ -323,7 +311,7 @@ resources:
|
||||||
floating_network:
|
floating_network:
|
||||||
get_param: external_network
|
get_param: external_network
|
||||||
port_id:
|
port_id:
|
||||||
get_resource: swarm_manager_eth0
|
get_resource: swarm_master_eth0
|
||||||
|
|
||||||
swarm_nodes:
|
swarm_nodes:
|
||||||
type: "OS::Heat::ResourceGroup"
|
type: "OS::Heat::ResourceGroup"
|
||||||
|
@ -344,12 +332,12 @@ resources:
|
||||||
http_proxy: {get_param: http_proxy}
|
http_proxy: {get_param: http_proxy}
|
||||||
https_proxy: {get_param: https_proxy}
|
https_proxy: {get_param: https_proxy}
|
||||||
no_proxy: {get_param: no_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:
|
outputs:
|
||||||
|
|
||||||
swarm_manager:
|
swarm_master:
|
||||||
value: {get_attr: [swarm_manager_floating, floating_ip_address]}
|
value: {get_attr: [swarm_master_floating, floating_ip_address]}
|
||||||
|
|
||||||
swarm_nodes:
|
swarm_nodes:
|
||||||
value: {get_attr: [swarm_nodes, swarm_node_ip]}
|
value: {get_attr: [swarm_nodes, swarm_node_ip]}
|
||||||
|
|
|
@ -53,9 +53,9 @@ parameters:
|
||||||
description: no proxies for docker
|
description: no proxies for docker
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
swarm_manager_ip:
|
swarm_master_ip:
|
||||||
type: string
|
type: string
|
||||||
description: swarm manager's ip address
|
description: swarm master's ip address
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ resources:
|
||||||
"$HTTP_PROXY": {get_param: http_proxy}
|
"$HTTP_PROXY": {get_param: http_proxy}
|
||||||
"$HTTPS_PROXY": {get_param: https_proxy}
|
"$HTTPS_PROXY": {get_param: https_proxy}
|
||||||
"$NO_PROXY": {get_param: no_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]}
|
"$NODE_IP": {get_attr: [swarm_node_eth0, fixed_ips, 0, ip_address]}
|
||||||
|
|
||||||
remove_docker_key:
|
remove_docker_key:
|
||||||
|
|
Loading…
Reference in New Issue