This is an Azure environment created using ARM templates to test Mixed OS Swarm features.
Requirements:
- Cloud Shell
git clone https://github.com/danielscholl/docker-swarm-hybrid
cd docker-swarm-hybrid
Access to the servers is via a ssh session and requires the user to create the SSH Keys in the home .ssh directory.
mkdir ~/.ssh && cd ~/.ssh
ssh-keygen -t rsa -b 2048 -C $(az account show --query user.name -otsv) -f id_rsa
The first step is to deploy the custom ARM Templates using the install.sh script. The script has two optional arguments.
- worker count (The number of Manager Nodes desired to be created ie: 2)
- manager count (The number of Nodes desired to be created ie: 2)
./install.sh 5 3
Once the template is deployed properly a few Azure CLI commands are run to create the items not supported by ARM Templates.
- A Storage Container is created for the REX-ray driver to use.
- A Service Principle is created with a clientID and clientSecret for the REX-ray driver to use to access AZURE.
Three files are automatically created to support the ansible installation process with the proper values.
This is the default ansible configuration file that is used by the provisioning process it identifies the location of the ssh keys and where the inventory file is located at.
[defaults]
inventory = ./ansible/inventories/azure//hosts
private_key_file = ~/.ssh/id_rsa
host_key_checking = false
export ANSIBLE_CONFIG=./.ansible.cfg
Check and validate ansible connectivity once provisioning has been completed and begin to configure the node servers.
ansible all -m ping #Check Connectivity
ansible-playbook ansible/playbooks/main.yml # Provision the node Servers
./sync.sh
- init.sh unique count (provision IaaS into azure)
- clean.sh unique count (delete IaaS from azure)
- connect.sh unique node (SSH Connect to the node instance)
- manage.sh unique command (deprovision/start/stop nodes in azure)
- lb.sh unique (manage loadbalancer ports to the swarm)
- lb.sh unique ls (list all lb rules)
- lb.sh unique create name portSrc:portDest (ie: create http 80:8080 --> Open port 80 map to 8080 on swarm and name it http)
- lb.sh unique rm name (remove lb rule)