All Projects → tpbowden → Swarm Ingress Router

tpbowden / Swarm Ingress Router

Licence: mit
Route DNS names to Swarm services based on labels

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Swarm Ingress Router

Tugbot
Testing in Production (TiP) Framework for Docker
Stars: ✭ 68 (-59.76%)
Mutual labels:  swarm
Bee
Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; censorship-resistant and self-sustaining network for storing your (application) data.
Stars: ✭ 108 (-36.09%)
Mutual labels:  swarm
Miniswarm
Docker Swarm cluster in one command
Stars: ✭ 130 (-23.08%)
Mutual labels:  swarm
Swarm Guide
Swarm Documentation
Stars: ✭ 78 (-53.85%)
Mutual labels:  swarm
Labs
This is a collection of tutorials for learning how to use Docker with various tools. Contributions welcome.
Stars: ✭ 10,443 (+6079.29%)
Mutual labels:  swarm
Spring Cloud Example
Stars: ✭ 111 (-34.32%)
Mutual labels:  swarm
Autodock
autodock is a Daemon for Docker Automation that helps to build automated Docker based infrastructure by integrating with Docker events
Stars: ✭ 61 (-63.91%)
Mutual labels:  swarm
Gofn
Function process via docker provider (serverless minimalist)
Stars: ✭ 134 (-20.71%)
Mutual labels:  swarm
Swarmz
A free, header-only C++ swarming (flocking) library for real-time applications
Stars: ✭ 108 (-36.09%)
Mutual labels:  swarm
Mongo Swarm
Bootstrapping MongoDB sharded clusters on Docker Swarm
Stars: ✭ 121 (-28.4%)
Mutual labels:  swarm
Agent
The Portainer agent
Stars: ✭ 87 (-48.52%)
Mutual labels:  swarm
Imagewolf
Fast Distribution of Docker Images on Clusters
Stars: ✭ 94 (-44.38%)
Mutual labels:  swarm
Web3.js
Ethereum JavaScript API
Stars: ✭ 12,601 (+7356.21%)
Mutual labels:  swarm
Amp
** THIS PROJECT IS STOPPED ** An open source CaaS for Docker, batteries included.
Stars: ✭ 74 (-56.21%)
Mutual labels:  swarm
Swarmprom
Docker Swarm instrumentation with Prometheus, Grafana, cAdvisor, Node Exporter and Alert Manager
Stars: ✭ 1,739 (+928.99%)
Mutual labels:  swarm
Swarmops
Manage swarm clusters to provide a more concise and compact intermediate layer web application with swarm ui.
Stars: ✭ 63 (-62.72%)
Mutual labels:  swarm
Geth Dev
A Docker Image to create a set of mining, local Ethereum nodes for development
Stars: ✭ 109 (-35.5%)
Mutual labels:  swarm
Docker Blinkt Workshop
Get into physical computing with Docker and Raspberry Pi
Stars: ✭ 151 (-10.65%)
Mutual labels:  swarm
Docker Handbook
Docker handbook
Stars: ✭ 133 (-21.3%)
Mutual labels:  swarm
Swarmlib
This repository implements several swarm optimization algorithms and visualizes them. Implemented algorithms: Particle Swarm Optimization (PSO), Firefly Algorithm (FA), Cuckoo Search (CS), Ant Colony Optimization (ACO), Artificial Bee Colony (ABC), Grey Wolf Optimizer (GWO) and Whale Optimization Algorithm (WOA)
Stars: ✭ 121 (-28.4%)
Mutual labels:  swarm

Swarm ingress router

This package is not maintained. Do not attempt to use in production

Try https://github.com/containous/traefik for all your reverse proxy needs


Route DNS names to labelled Swarm services using Docker 1.12's internal service load balancing

Build Status Go Report Card

Features

  • No external load balancer or config files needed making for easy deployments
  • Integrated TLS decryption for services which provide a certificate and key
  • Automatic service discovery and load balancing handled by Docker
  • Scaled and maintained by the Swarm for high resilience and performance
  • Incredibly lightweight image (less than 20MB after decompression)

Installation

These are the manual steps to install the app. You can run bootstrap.sh to quickly create the required services automatically.

First of all you will need to create a network for your frontend services to run on and one for storage:

docker network create --driver=overlay frontends
docker network create --driver=overlay router-management

Next you need to start Redis which will store service configuration

docker service create --name router-storage --network router-management redis:3.2-alpine

Then you have to start the router's backend on management network. The service must be restricted to run only on master nodes (as it has to query for services).

docker service create --name router-backend --constraint node.role==manager --mount \
  target=/var/run/docker.sock,source=/var/run/docker.sock,type=bind --network router-management \
  tpbowden/swarm-ingress-router:latest -r router-storage:6379 collector

Now you can start the router's frontend on both the management and frontend network. It must listen on the standard HTTP/HTTPS ports

docker service create --name router --mode global -p 80:8080 -p 443:8443 --network frontends \
  --network router-management tpbowden/swarm-ingress-router:latest -r \
  router-storage:6379 server -b 0.0.0.0

Start a demo app

Finally, start your frontend service on the frontends network and it will be available on all of your Swarm nodes:

docker service create --name frontend --label ingress=true --label ingress.dnsname=example.local \
  --label ingress.targetport=80 --network frontends --label ingress.tls=true --label \
  ingress.forcetls=true --label ingress.cert="$(cat fixtures/cert.crt)" --label \
  ingress.key="$(cat fixtures/key.key)" nginx:stable-alpine

If you add a DNS record for example.local pointing to your Docker node in /etc/hosts you will be routed to the service.

Usage

In order for the router to pick up a service, the service must have the following labels:

  • ingress=true
  • ingress.dnsname=<your service's external DNS name>
  • ingress.targetport=<your service's externally-facing port>

For TLS you need the following lables:

  • ingress.tls=true
  • ingress.cert="$(cat <your crt file>)"
  • ingress.key="$(cat <your key file>"

To force services to force TLS you can also use the following label:

  • ingress.forcetls=true

You do not need to publish the service's port as a node port as long as it is exposed internally and on the same network as the router.

Todo

  • Better logging
  • Command line argument for log level
  • Use Docker events to stay in sync and long polling as a fallback
  • Create a docker-compose file which can be converted into a stack
  • Add a heathcheck endpoint and use Docker's HEALTHCHECK instruction to ensure maximum uptime
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].