So you have your Docker Swarm up and running, and it’s pretty empty, and you want to deploy applications to your Swarm.
The main idea was to have a central place with repositories for different stacks, almost like a template store where you can pick and choose, how you would like your stack to look like.
So I started this project “BekkerStacks” with the intention to deploy applications to Docker Swarm in a simplistic manner.
A deployment flow for a reverse proxy and web based application will look like this:
*.mydomain.comto your Hosts where Traefik will run.
DOMAIN=mydomain.com bash traefik/deploy.sh
DOMAIN=mydomain.com bash mediawiki/deploy.sh
I started this project about a month ago, and at this point in time, the list includes:
I will be adding more as the time goes by.
If you don’t have a Docker Swarm provisioned, you can provision one for free using:
Let’s do a Deployment with Traefik as our Ingress Load Balancer / Reverse Proxy that will automatically enable HTTPS on your website with a Let’s Encrypt Certificate (by default, http mode only is also available)
Then deploy a Monitoring Stack, CPANG (Prometheus, cAdvisor, Node-Exporter, Grafana) to our Swarm
Get the sources:
$ git clone https://github.com/bekkerstacks/traefik
The compose file relies on a environment variable
DOMAIN to map the frontend rules to Traefik.
In this case, setting
DOMAIN=myswarm.dev will deploy Traefik with it’s frontend rule as
Set the environment variable:
$ export DOMAIN=myswarm.dev
$ export DOMAIN=localhost $ export BSTACKS_MODE=http $ cd traefik $ bash deploy.sh deploying traefik stack in http mode Creating network public Creating config proxy_traefik_htpasswd Creating service proxy_traefik traefik ui is available at: - http://traefik.localhost
By default the authentication for Traefik’s UI will be admin/admin, you can change the default behavior by checking out the docs
Accessing Traefik’s UI:
The monitoring stack provides you with 2 options:
The mode and feature will be controlled by the environment variables:
BSTACKS_MODE - (http/https) BSTACKS_FEATURE - (dashboards)
Let’s deploy the monitoring stack in http mode with dashboards pre-configured:
$ export BSTACKS_MODE=http $ export BSTACKS_FEATURE=dashboards $ git clone https://github.com/bekkerstacks/monitoring-cpang $ cd monitoring-cpang $ bash deploy.sh deploying monitoring stack in http mode with dashboards pre-configured Creating network private Creating config mon_alertmanager_config Creating config mon_prometheus_config Creating config mon_prometheus_rules Creating config mon_grafana_config_datasource Creating config mon_grafana_dashboard_prometheus Creating config mon_grafana_dashboard_docker Creating config mon_grafana_dashboard_dockerprometheus Creating config mon_grafana_dashboard_blackbox Creating service mon_prometheus Creating service mon_grafana Creating service mon_cadvisor Creating service mon_node-exporter Creating service mon_blackbox-exporter Creating service mon_alertmanager Stack is available at: - http://grafana.localhost - http://alertmanager.localhost - http://prometheus.localhost
Accessing Grafana with the default configuration (admin/admin) will ask you to change the password.
After changing your password, you will be directed to the home dashboard:
Docker Swarm Service Dashboard:
Docker Swarm Nodes Dashboard:
Further ideas will be:
That’s it for now, I would love to hear what you think about the idea, or feel free to reach out to me or share this post using the tools below: