Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aelsabbahy committed Aug 8, 2016
1 parent 5b0bf9d commit cb89e7e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Miniswarm is a tool that intends to make creating a local [Docker swarm](https:/
## Miniswarm and Docker swarm healthchecks tutorial (less than 10min)
I like to learn by doing, hopefully you do too. Lets install miniswarm, create a swarm cluster, deploy some apps and learn all the features of miniswarm in the process.

**install**
**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
**Start a cluster - Pick your desired size**
```
# 1 manger 2 workers
miniswarm start 3
Expand All @@ -36,7 +36,7 @@ INFO: Stack starup complete. To connect to your stack, run the following command
INFO: eval $(docker-machine env ms-manager0)
```

**visualize your cluster**
**Visualize your cluster**

This will open a browser with a nice visualization of your docker swarm using [docker-swarm-visualizer](https://github.com/ManoMarks/docker-swarm-visualizer)
```
Expand Down Expand Up @@ -155,8 +155,25 @@ Mostly shameless self-promotion, and while we're on the topic, check out:
* [Goss](https://github.com/aelsabbahy/goss) - Project page
* [blog post](https://medium.com/@aelsabbahy/docker-1-12-kubernetes-simplified-health-checks-and-container-ordering-with-goss-fa8debbe676c) - On Using Goss with docker healthchecks and Kubernetes

## 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?
Becaause Dockerhub doesn't support HEALTHCHECK in Dockerfile yet. The code for this image can be found in the [healthyvote/](https://github.com/aelsabbahy/miniswarm/tree/master/healthyvote) folder.
Because Dockerhub doesn't support HEALTHCHECK in Dockerfile yet. The code for this image can be found in the [healthyvote/](https://github.com/aelsabbahy/miniswarm/tree/master/healthyvote) folder.

## 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 does this suck?

Expand Down
6 changes: 4 additions & 2 deletions miniswarm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
DEF_COLOR=""
GREEN=""
RED=""
if ! [[ ${MS_NO_COLOR:-""} ]]; then
if ! [[ ${MS_NOCOLOR:-""} ]]; then
DEF_COLOR="\x1b[0m"
GREEN="\x1b[32;01m"
RED="\x1b[31;01m"
Expand Down Expand Up @@ -126,10 +126,12 @@ node_in_cluster() {
# Drain and leave the cluster
leave_cluster() {
if node_in_cluster "$1"; then
info "Draining node: $1"
docker-machine ssh ms-manager0 docker node update --availability drain "$1" | line_prefix "$1"
# Give it a few sec to drain
# FIXME: There's probably a better way to do this
sleep 3
sleep 5
info "Leaving cluster: $1"
docker-machine ssh "$1" docker swarm leave --force 2>&1 | line_prefix "$1"
fi
}
Expand Down

0 comments on commit cb89e7e

Please sign in to comment.