Halo, kalau kamu merasa tulisan saya ngebantu kamu, kamu bisa ucapkan terima kasih lewat saweria .

If you feel this website help you, you can donate at saweria .



The Problem

Client said their portainer was really slow. It cannot opened anything.

When change menu, it takes forever to load.

So they ask, is there any alternative? They only need app to check their cluster log and re-scale service


Here’s Come Swarmpit

Swarmpit introduce themself as a “Lightweight mobile-friendly Docker Swarm management UI”, and they really prove that.

It more simple, fast and robust than Portainer.

It fullfill my client criteria, it can show app log and you can re-scale services from there

It Show All Info and It was Faster Than Portainer

It Show All Info and It was Faster Than Portainer

Swarmpit Log Viewer

Swarmpit Log Viewer


How to install Swarmpit:

  1. Create docker-compose.yml
version: '3.3'

services:
  app:
    image: swarmpit/swarmpit:latest
    logging:
      driver: none
    environment:
      - SWARMPIT_DB=http://db:5984
      - SWARMPIT_INFLUXDB=http://influxdb:8086
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 888:8080
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080"]
      interval: 60s
      timeout: 10s
      retries: 3
    networks:
      - net
    deploy:
      resources:
        limits:
          cpus: '0.50'
          memory: 1024M
        reservations:
          cpus: '0.25'
          memory: 512M
      placement:
        #use specific server to deploy
        #to avoid any error
        constraints:
          - node.role == manager
          - node.hostname == server-1

  db:
    image: couchdb:2.3.0
    logging:
      driver: none

    volumes:
      - db-data:/opt/couchdb/data
    networks:
      - net
    deploy:
      resources:
        limits:
          cpus: '0.30'
          memory: 256M
        reservations:
          cpus: '0.15'
          memory: 128M
      placement:
        #use specific server to deploy
        #to avoid any error
        constraints:
          - node.role == manager
          - node.hostname == server-1

  influxdb:
    image: influxdb:1.8
    logging:
      driver: none

    volumes:
      - influx-data:/var/lib/influxdb
    networks:
      - net
    deploy:
      resources:
        limits:
          cpus: '0.60'
          memory: 512M
        reservations:
          cpus: '0.30'
          memory: 128M
      placement:
        #use specific server to deploy
        #to avoid any error
        constraints:
          - node.role == manager
          - node.hostname == server-1

  agent:
    image: swarmpit/agent:latest
    logging:
      driver: none

    environment:
      - DOCKER_API_VERSION=1.35
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - net
    deploy:
      mode: global
      labels:
        swarmpit.agent: 'true'
      resources:
        limits:
          cpus: '0.10'
          memory: 64M
        reservations:
          cpus: '0.05'
          memory: 32M

networks:
  net:
    driver: overlay

volumes:
  db-data:
    driver: local
  influx-data:
    driver: local
  1. Run with docker stack deploy -c docker-compose.yml swarmpit

Common Issues

Common issues at Swarmpit installation

  1. Request execution failed! Scope at influxDB log. Solution, since it can find any influxDB server, please use constraint it will make influxDB installed on specific server. This problem solution applied to Swarmpit and CouchDB service as well

  2. It not showing hardware specification web page. Solution, make sure you opened all swarm mode port

Cannot Show Hardware Info

Cannot Show Hardware Info


References:

Github Swarmpit