/docker-swarm-win

A Template to deploy IaaS for a simple Windows Swarm

Primary LanguagePowerShellMIT LicenseMIT

docker-swarm-win

This repository is a sample solution deploying IaaS neccessary for a Windows Swarm.

Automatic Deploy

PowerShell Deploy

  1. Create a Resource Group
az group create --location southcentralus --name docker-win-swarm
Connect-AzureRMAccount

$ResourceGroupName = 'docker-win-swarm'
$Location = 'southcentralus'
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location
  1. Modify Template Parameters as desired

  2. Deploy Template to Resource Group

az group deployment create --name docker-win-swarm /
 --template-file azuredeploy.json /
 --parameters azuredeploy.parameters.json /
 --resource-group docker-win-swarm
New-AzureRmResourceGroupDeployment -Name docker-win-swarm `
  -TemplateFile azuredeploy.json `
  -TemplateParameterFile azuredeploy.parameters.json `
  -ResourceGroupName $ResourceGroupName 

Initialize a Swarm

Windows Swarm Mode Documentation

The loadbalancer Public IP Address is used to RDP into the Servers.

Example: :5000 -- vm0 :5001 -- vm1

Swarm Master Init Example

$IP=((ipconfig | findstr [0-9].\.)[0]).Split()[-1]
docker swarm init --advertise-addr=${IP} --listen-addr ${IP}:2377

# Example Result
Swarm initialized: current node (iin85eksly3485m7m26ij7var) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token <your_token> 10.1.0.4:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

Swarm Worker Join Example

docker swarm join --token <your_token> 10.1.0.4:2377