Hi, I'm Ruan.

Systems Development Engineer, DevOps, Linux, AWS, Python

Introducing BekkerStacks for Easy Application Deployment

Jun 28, 2019 | 3 minutes read

Say Thanks! Slack Status Chat on Slack Drone.io Build Status GitHub followers Twitter Follow

docker-swarm-image-from-docker.com

BekkerStacks, what is it?

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.

How would a deployment look like?

A deployment flow for a reverse proxy and web based application will look like this:

  1. Set your DNS *.mydomain.com to your Hosts where Traefik will run.
  2. Search for Traefik and Mediawiki on bekkerstacks
  3. Clone the repositories
  4. Deploy Traefik with DOMAIN=mydomain.com bash traefik/deploy.sh
  5. Deploy Mediawiki with DOMAIN=mydomain.com bash mediawiki/deploy.sh
  6. Access your deployment on https://mediawiki.mydomain.com

What’s in the BekkerStacks Store?

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.

Enough talking, show me a Demo

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

Deploy Traefik

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 traefik.myswarm.dev

Set the environment variable:

$ export DOMAIN=myswarm.dev

Deploy Traefik:

$ 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:

Deploy a Monitoring Stack

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:

image

Docker Swarm Service Dashboard:

image

Docker Swarm Nodes Dashboard:

image

Further ideas

Further ideas will be:

Thanks

Say Thanks! Slack Status Chat on Slack Drone.io Build Status GitHub followers Twitter Follow

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:


Share to Twitter

StumbleUpon

Reddit

LinkedIn

Email

Facebook


TOP