Giter Club home page Giter Club logo

windows10-docker-swarm's Introduction

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, but you need to be registered to the Windows Insider program.

For the next step you need Packer. You have several ways how to install it. The easiest way is to install it via Homebrew. After you have installed Homebrew. Run the following command when you installed Homebrew:

brew install packer

If you don't have the Vagrant windows_10_15042 base box you need to create it first with Packer. See my 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

Demo

Have a look at the folder 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

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

With both Visualizer and Portainer you could demonstrate scaling services

visualizer and portainer

windows10-docker-swarm's People

Contributors

patricklang avatar stefanscherer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

myang32 ameyag

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.