All Projects → aelsabbahy → Miniswarm

aelsabbahy / Miniswarm

Licence: apache-2.0
Docker Swarm cluster in one command

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Miniswarm

Please Contain Yourself
A Docker tutorial written for people who don't actually know Docker already.
Stars: ✭ 385 (+196.15%)
Mutual labels:  tutorial, containers, docker-swarm
clusterplex
ClusterPlex is basically an extended version of Plex, which supports distributed Workers across a cluster to handle transcoding requests.
Stars: ✭ 123 (-5.38%)
Mutual labels:  cluster, docker-swarm, swarm
Verwalter
A tool which manages cluster of services
Stars: ✭ 34 (-73.85%)
Mutual labels:  containers, cluster
Docker Swarm
🐳🐳🐳 This repository is part of a blog series on Docker Swarm example using VirtualBox, OVH Openstack, Azure and Amazon Web Services AWS
Stars: ✭ 43 (-66.92%)
Mutual labels:  cluster, docker-swarm
Browncoat
Container for testing app failures in orchestrators. It aims to misbehave.
Stars: ✭ 49 (-62.31%)
Mutual labels:  containers, swarm
Fn
The container native, cloud agnostic serverless platform.
Stars: ✭ 5,046 (+3781.54%)
Mutual labels:  containers, swarm
Eliasdb
EliasDB a graph-based database.
Stars: ✭ 611 (+370%)
Mutual labels:  tutorial, cluster
Docker Swarm Cookbook
A large collection of recipes for a complete, self-hosted Docker Swarm stack including Traefik v2 and SSO/Auth
Stars: ✭ 49 (-62.31%)
Mutual labels:  swarm, docker-swarm
Picluster
A Simplified Docker Swarm or Kubernetes Alternative to Container Scheduling and Orchestration
Stars: ✭ 390 (+200%)
Mutual labels:  containers, cluster
Pico
Object Detection and Analysis Made easy using Raspberry Pi, Apache Kafka, AWS Rekognition & Docker
Stars: ✭ 63 (-51.54%)
Mutual labels:  containers, docker-swarm
Terraform Digitalocean Docker Swarm Mode
Terraform module for provisioning a Docker Swarm mode cluster on DigitalOcean
Stars: ✭ 59 (-54.62%)
Mutual labels:  cluster, swarm
Amp
** THIS PROJECT IS STOPPED ** An open source CaaS for Docker, batteries included.
Stars: ✭ 74 (-43.08%)
Mutual labels:  cluster, swarm
Minikube
Run Kubernetes locally
Stars: ✭ 22,673 (+17340.77%)
Mutual labels:  containers, cluster
Minimesos
The experimentation and testing tool for Apache Mesos - NO LONGER MAINTANED!
Stars: ✭ 429 (+230%)
Mutual labels:  containers, cluster
Caprover
Scalable PaaS (automated Docker+nginx) - aka Heroku on Steroids
Stars: ✭ 7,964 (+6026.15%)
Mutual labels:  containers, docker-swarm
Kube Spawn
A tool for creating multi-node Kubernetes clusters on a Linux machine using kubeadm & systemd-nspawn. Brought to you by the Kinvolk team.
Stars: ✭ 392 (+201.54%)
Mutual labels:  containers, cluster
Giropops Monitoring
Full stack tools for monitoring containers and other stuff. ;)
Stars: ✭ 1,019 (+683.85%)
Mutual labels:  containers, docker-swarm
Dogvscat
Sample Docker Swarm cluster stack of tools
Stars: ✭ 377 (+190%)
Mutual labels:  containers, swarm
Docker For All
Docker applied in development, devops, testing, product management etc.
Stars: ✭ 88 (-32.31%)
Mutual labels:  containers, docker-swarm
Acs Engine
WE HAVE MOVED: Please join us at Azure/aks-engine!
Stars: ✭ 1,049 (+706.92%)
Mutual labels:  containers, swarm

Miniswarm - Docker Swarm cluster in one command

One command?

Yup, creating a 3 node cluster is simply:

miniswarm start 3

When you're done:

miniswarm delete

What is Miniswarm?

Miniswarm is a tool that intends to make creating and managing a local Docker Swarm cluster as easy as possible. Miniswarm was inspired by Minikube which does a similar thing for kubernetes clusters. See FAQ below for info on managing a remote Swarm cluster.

The tool takes less than 10 minutes to learn, see the tutorial section below, or watch this tutorial video:

Prerequisites

  • Docker >= 1.12
  • docker-machine >= 0.7.0
  • VirtualBox - Needed for local cluster, see FAQ for remote Swarm cluster

Miniswarm: Local Docker Swarm and Docker health check tutorial (less than 10min)

In this tutorial we'll install miniswarm, create a Swarm cluster, deploy some apps and learn all the features of miniswarm in the process.

Install

# As root
curl -sSL https://raw.githubusercontent.com/aelsabbahy/miniswarm/master/miniswarm -o /usr/local/bin/miniswarm
chmod +rx /usr/local/bin/miniswarm

Start a cluster - Pick your desired size

# 1 manager 2 workers
miniswarm start 3

# 1 manager cluster - if you want a smaller cluster
miniswarm start

# 2 managers 3 workers - nice laptop or desktop :)
miniswarm start 2 3

A couple of minutes later, you should get this message

INFO: Stack starup complete. To connect to your stack, run the following command:
INFO: eval $(docker-machine env ms-manager0)

Visualize your cluster

This will open a browser with a nice visualization of your Docker Swarm using docker-swarm-visualizer

miniswarm vis

Deploy your first service - This will initially be failing to showcase healtchecks

This service will be unhealthy due to failing Goss healthchecks and missing dependencies. See next few steps for how we can debug and remedy this.

# Connect to your cluster
eval $(docker-machine env ms-manager0)

# Create a network for your service
docker network create -d overlay healthyvote_net

# Ensure network is set to driver=overlay, scope=swarm
docker network ls

# Create your first service
docker service create -p 8080:80 --replicas 2 --network healthyvote_net --name vote aelsabbahy/healthyvote

Inspect the service health

# Wait for the service to finish preparing, but it won't ever be ready due to failing health
docker service ls
docker service ps vote

# Lets look at the healthchecks using miniswarm
# -a shows all containers, including exited/failed containers
miniswarm health vote -a

We should see something like this:

[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] ======
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Start: 2016-08-07 22:39:03.748704565 +0000 UTC
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] ======
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] .F
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Failures/Skipped:
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Title: Redis backend is reachable
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Meta:
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]     remedy.1: Deploy redis service if you haven't already
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]     remedy.2: ctrl-alt-delete
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]     remedy.3: take a nap aka human ctrl-alt-delete
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Addr: tcp://redis:6379: reachable:
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Expected
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]     <bool>: false
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] to equal
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]     <bool>: true
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q]
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Total Duration: 0.500s
[ms-worker0 vote.2.630mookf9pnc8dip5hl7yng3q] Count: 2, Failed: 1, Skipped: 0

Deploy missing dependencies

Lets remedy the healthcheck issue

docker service create --replicas 1 --network healthyvote_net --name redis redis

# Wait for it to show up in `miniswarm vis` or by using CLI
docker service ls
docker service ps redis

# Now that redis is deployed, the  vote service should now be running
docker service ls

# And the health..
miniswarm health vote

Open service in browser

# Open app in browser
miniswarm service vote

# print url, but don't open (--url has to be at the end for now)
miniswarm service vote --url

View the logs

miniswarm logs vote

# Tail the log file (-f has to be at the end for now)
miniswarm logs vote -f

Scale down your cluster

# Take a look at `miniswarm vis` GUI to see the services move around as we scale down
miniswarm scale 2

Delete your cluster

miniswarm delete

FAQ

Can this be used to manage a remote Swarm cluster?

The tool was written with local Swarm cluster in mind. That said, it can probably be used to manage a remote Swarm clusters, but that hasn't been tested. Take a look at MACHINE_DRIVER variable at the top of the script.

In theory, if you set the MACHINE_DRIVER variable to the driver you want + any required variables from the driver itself, see supported drivers it should just work. Feel free to submit a pull-request to improve this or add more support.

How do I disable the color output?

MS_NOCOLOR=1 miniswarm ..

# or
export MS_NOCOLOR=1
miniswarm ...

Does this work on Mac/OSX?

It should, but I don't own a Mac, so I depend on others to verify it. So.. if something is broke on mac, please submit a pull request.

Why did you use Goss for healthchecks?

Mostly shameless self-promotion, and while we're on the topic, check out:

  • Goss - Project page
  • blog post - Using Goss with Docker healthchecks and Kubernetes

Why the #[email protected]^%$ is this written in Bash?

Two reasons:

  1. I though it was going to be ~100 lines of bash, I was wrong.. very wrong :(.
  2. I want users to be able to look at this script and see all the commands needed to set up a Swarm cluster.
  • Go would be great for this tool, especially by leveraging the Docker go packages directly, but then the tool will be more of a blackbox to new users

I'm getting intermittent network issues, why is this happening?

Honestly, I don't know.. I see them too. Either I'm doing something dumb, or Docker Swarm mode has intermittent DNS issues. Hopefully with more users we can get to the bottom of this.

Why is healthyvote not a Docker automated build?

Because Dockerhub doesn't support HEALTHCHECK in Dockerfile yet. The code for this image can be found in the healthyvote/ folder.

Why does this suck?

Because it's a quick hack I did over the weekend.. or I suck.. maybe both?

I tried to use it and got an error

Open an issue, create a pull request.. contribute! :)

Why is the CLI parsing so bad?

See the last two questions.

Social Media:

  • Twitter Follow - Stay updated on new releases
  • Twitter URL - If you like miniswarm, spread the word!
  • Blog - See what I'm ranting about
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].