Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/StefanScherer/windows10-docker-swarm
Windows 10 Insider + Docker swarm-mode
https://github.com/StefanScherer/windows10-docker-swarm
docker docker-swarm windows-containers windows10
Last synced: 3 months ago
JSON representation
Windows 10 Insider + Docker swarm-mode
- Host: GitHub
- URL: https://github.com/StefanScherer/windows10-docker-swarm
- Owner: StefanScherer
- License: mit
- Created: 2017-02-17T22:22:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-06T07:18:30.000Z (over 7 years ago)
- Last Synced: 2024-05-28T03:21:28.547Z (5 months ago)
- Topics: docker, docker-swarm, windows-containers, windows10
- Language: PowerShell
- Homepage: https://stefanscherer.github.io/docker-swarm-mode-windows10/
- Size: 7.14 MB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - StefanScherer/windows10-docker-swarm - Windows 10 Insider + Docker swarm-mode (PowerShell)
README
# Windows 10 Docker swarm-mode
This is a local setup using Vagrant with VMware Fusion to demonstrate a Windows 10 Insider Docker swarm-mode.
This repo is tested with Vagrant 1.9.2 and VMware Fusion Pro 8.5.3. VirtualBox does not work as it doesn't support nested virtualization.
## Get the base box
First download the latest [Windows 10 Insider 15042 ISO](https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewadvanced), but you need to be registered to the Windows Insider program.
For the next step you need [Packer](https://packer.io). You have several ways how to install it. The easiest way is to install it via [Homebrew](http://brew.sh/). After you have installed Homebrew. Run the following command when you installed Homebrew:
```bash
brew install packer
```
If you don't have the Vagrant `windows_10_15042` base box you need to create it first with [Packer](https://packer.io). See my [packer-windows](https://github.com/StefanScherer/packer-windows) repo to build the base box.To build the base box you have to run these commands on your host machine:
```
git clone https://github.com/StefanScherer/packer-windows
cd packer-windows
packer build --only=vmware-iso --var iso_url=~/Downloads/Windows10_InsiderPreview_EnterpriseVL_x64_en-us_15042.iso windows_10_insider.json
vagrant box add windows_10_15042 windows_10_insider_vmware.box
```## Vagrant boxes
There are three VM's with the following internal network and IP addresses:
| VM | IP address | Memory |
|-----------|--------------|--------|
| sw-win-01 | 192.168.36.2 | 3GB |
| sw-win-02 | 192.168.36.3 | 3GB |
| sw-win-03 | 192.168.36.4 | 3GB |Depending on your host's memory you can spin up one or more Windows 10 VM's.
## Swarm Manager
The `sw-win-01` is the Swarm manager.
## Swarm worker
The `sw-win-02` and `sw-win-03` are Swarm workers.
![swarm-mode](images/swarm-mode.png)
## Demo
Have a look at the folder [`demo`](https://github.com/StefanScherer/windows10-docker-swarm/tree/master/demo) with some helper scripts to create a overlay network, a scaled service and a consumer trying to fetch data from this service using the overlay network.
## Example usage
Open a PowerShell window in the `sw-win-01` machine and create a service
```
PS C:\> docker service create --name=whoami stefanscherer/whoami-windows:latest
```Check the service
```
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 1/1 stefanscherer/whoami-windows:latest
```Then scale up the service
```
PS C:\> docker service scale whoami=10
whoami scaled to 10
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 6/10 stefanscherer/whoami-windows:latest
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 6/10 stefanscherer/whoami-windows:latest
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 10/10 stefanscherer/whoami-windows:latest
```## Visualizer
Open a PowerShell window on the `sw-win-01` machine and run the script
```
C:\vagrant\scripts\run-visualizer.ps1
```Now open a browser to see the visualizer UI. I use the IP address of the manager VM and open a browser on my host machine.
![visualizer](images/visualizer.png)
## Portainer
Open a PowerShell window on the `sw-win-01` machine and run the script
```
C:\vagrant\scripts\run-portainer.ps1
```Now open a browser to see the Portainer UI. Portainer is started as a Docker service. At the
moment you can't use `--publish` on Windows. So we have to pick the IP address of the container
to open it in a browser. Run the helper script```
C:\vagrant\scripts\open-portainer-ui.ps1
```![portainer](images/portainer.png)
With both Visualizer and Portainer you could demonstrate scaling services
![visualizer and portainer](images/visualizer-portainer.gif)