Giter Club home page Giter Club logo

haproxy-etcd-rest's Introduction

HAProxy with ETCD for REST

Jochen Mader <[email protected]> v0.1, October 2015: Initial version.

== Introduction

HAProxy is a feature rich, easy to configure reverse proxy.
ETCD is the distributed hierarchical key/value-store from the CoreOS-project.
This project provides some shell infrastructure to make HAProxy pull lists of hosts and their associated HTTP-URLs from ETCD.

== Purpose

This project is geared towards being used for experimenting with microservices. It gives some ideas on how to do this in production but it’s aim is to be usable on a local machine without too much effort.

== How it works

Let’s say we want to map the following URLs:

/browse
/detail
/checkout

Create a directory for each one in ETCD. Usin cURl you could do the following to create the checkout-service and add a host.

curl -L http://<etcdhost>/v2/keys/checkout -XPUT -d dir=true
curl -L http://<etcdhost>/v2/keys/checkout/<nodename> -XPUT -d value="<host:port>"&ttl=15
  • <etcdhost>: Host of your ETCD-instance

  • <nodename>: A name for your node for easier debugging

  • <host:port>: Host and port under which the URL resides. In this case the service should be reachable as http://<host:port>/checkout

== Starting it

Get ETCD installed. Being an Apple user I use Homebrew for this:

brew install etcd

Start watching

etcdctl exec-watch --recursive / -- ./build_cfg_and_reload.sh

haproxy-etcd-rest's People

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.