Swarmpit provides simple and easy to use interface for Docker Swarm cluster. using swarmpit we can manage docker stacks, services, secrets, volumes, networks, docker nodes etc, swarm cluster we can manage through UI
Pre-requisites:
- install docker on server
- start the docker service
Steps to install swarmpit:
We deploy swarmpit stack file server using CLI
docker swarm init
git clone https://github.com/swarmpit/swarmpit -b masterdocker stack deploy -c swarmpit/docker-compose.yml swarmpit
swarmpit runs on port 888, so open your browser http://<IP>:888
This stack file consists of mainly 4 things
- app — Swarmpit
- agent — Swarmpit agent
- db — CouchDB (Application data)
- influxdb — InfluxDB (Cluster statistics)
Couch DB contains users and stack files, configs, secrets, when we want to restore we need to take this backup, this is a docker volume located at /var/lib/docker/volumes
Deploying a stack file in swarmpit:
- go to UI → Applications → stacks
- create a new stack , here i am creating stack file for nginx
version: “3”
services:
nginx:
image: nginx
ports:
- 80:80
- 443:443
deploy:
mode: replicated
replicas: 3
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 3
window: 120s
open the port 80 and login to browser http://<IP>