Skip to content

A light-weight reverse proxy service adapts with Consul. Makes your old projects integratable.

License

Notifications You must be signed in to change notification settings

RickoNoNo3/consulize

Repository files navigation

Consulize

Make every HTTP server under Consul.

A very light-weight reverse proxy service, registered to Consul, proxying to your own URLs. No more modification into your existing servers.

If you are using load balance or routing tools, like Fabio, Consulize may bring an exciting routes taste to you.

structure

Installation

With Docker

docker pull rickonono3/consulize:latest

See the compose example

With Standalone Binaries

See Releases, and How to run-consulize.sh

From Source

You can easily build a single-file executable in your machine by using Go programming language:

git clone https://github.com/rickonono3/consulize # or download a source archive
cd consulize
go get
go build -o consulize .
/bin/bash run-consulize.sh

Usage

Consulize is configured by environment variables. Below is some of them (Other Configurables of Consul in doc)

Env Default Value Description
TARGET http://127.0.0.1:80 Full URL to your existing server
TAGS [ ] Tags when registering to Consul.
Must be a JSON ARRAY
TAGS_FILE Path to a JSON file. Same format to TAGS, they will be merged together
CONSUL_HTTP_ADDR 127.0.0.1:8500 host:port to a Consul Server
CONSUL_HTTP_TOKEN
CONSUL_HTTP_TOKEN_FILE
SERVICE_NAME consulize Your own service name
SERVICE_ID <serviceName>-<randomInt> Your own service id
SERVICE_HOST_FROM_CONSUL 127.0.0.1 The host, where Consul sends requests to Consulize.
SERVICE_PORT 8890 The port Consulize would listen on.
TRANSMIT_HEALTH false Check health of the target server self instead of Consulize
HEALTH_PATH /health
HEALTH_TIMEOUT 3s
HEALTH_INTERVAL 5s
DEREGISTER_CRITICAL_SERVICE_AFTER 30s Automatically deregister after check fails for a period of time