GitXplorerGitXplorer
l

Swarmpit

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
056a4ddd4884f61df81d88695da8268576bae568

Delete traefik-host.yml

lluizjr committed 5 years ago
Verified
1a7cdbb507f7f3b5c7982a29fab28b12b965e06c

Create swarmpit.yml

lluizjr committed 5 years ago
Verified
8348f88a44671d1c62ad802c194bbc5d2f62f8e5

Update README.md

lluizjr committed 5 years ago
Unverified
4206f8922cedc8e63ea567e1c93fdab0430d125d

first commit

lluizjr committed 5 years ago

README

The README file for this repository.

Swarmpit

Swarmpit provides a nice and clean way to manage your Docker Swarm cluster.

Follow this guide to integrate it in your Docker Swarm mode cluster deployed as described in DockerSwarm.rocks with a global Traefik HTTPS proxy.

Here's one of the screens:

Preparation

  • Connect via SSH to a Docker Swarm manager node.

  • Create an environment variable with the domain where you want to access your Swarmpit instance, e.g.:

export DOMAIN=swarmpit.sys.example.com
  • Make sure that your DNS records point that domain (e.g. swarmpit.sys.example.com) to one of the IPs of the Docker Swarm mode cluster.

  • Get the Swarm node ID of this (manager) node and store it in an environment variable:

export NODE_ID=$(docker info -f '{{.Swarm.NodeID}}')
  • Create a tag in this node, so that the database used by Swarmpit is always deployed to the same node and uses the existing volume:
docker node update --label-add swarmpit.db-data=true $NODE_ID

Create the Docker Compose file

  • Download the file swarmpit.yml:
curl -L dockerswarm.rocks/swarmpit.yml -o swarmpit.yml
  • ...or create it manually, for example, using nano:
nano swarmpit.yml
  • And copy the contents inside:
{!./swarmpit.yml!}

!!! info This is just a standard Docker Compose file.

It's common to name the file `docker-compose.yml` or something like `docker-compose.swarmpit.yml`.

Here it's named just `swarmpit.yml` for brevity.

Deploy it

Deploy the stack with:

docker stack deploy -c swarmpit.yml swarmpit

It will use the environment variables you created above.

Check it

  • Check if the stack was deployed with:
docker stack ps swarmpit

It will output something like:

ID             NAME                       IMAGE                      NODE                DESIRED STATE   CURRENT STATE          ERROR   PORT
kkhasdfvce30   swarmpit_agent.ndasdfav5   swarmpit/agent:latest      dog.example.com     Running         Running 3 minutes ago
k8oasdfg70jm   swarmpit_agent.i9asdfjps   swarmpit/agent:latest      cat.example.com     Running         Running 3 minutes ago
kcvasdft0yzj   swarmpit_agent.3jasdfd3k   swarmpit/agent:latest      snake.example.com   Running         Running 3 minutes ago
9onasdfzopve   swarmpit_agent.r6asdfb20   swarmpit/agent:latest      snake.example.com   Running         Running 3 minutes ago
fxoasdfwjrbj   swarmpit_db.1              couchdb:2.3.0              dog.example.com     Running         Running 3 minutes ago
m4jasdf3369c   swarmpit_app.1             swarmpit/swarmpit:latest   cat.example.com     Running         Running 3 minutes ago
  • You can check the Swarmpit logs with:
docker service logs swarmpit_app

Check the user interfaces

After some seconds/minutes, Traefik will acquire the HTTPS certificates for the web user interface.

You will be able to securely access the web UI at https://<your swarmpit domain> where you can create your username and password.