Vamp Gateway Agent
April 20, 2018 ยท View on GitHub
Based on Vamp gateways, Vamp generates HAProxy configuration and stores it to KV store.
Vamp Gateway Agent:
- reads the HAProxy configuration using confd
- appends it to the base configuration
haproxy.basic.cnf - if new configuration is valid, VGA reloads HAProxy with as little client traffic interruption as possible
In addition to this VGA also:
- send HAProxy log to Elasticsearch using Filebeat
- handle and recover from ZooKeeper, etcd, Consul and Vault outages without interrupting the haproxy process and client requests
- does Vault token renewal if needed
Usage
Following environment variables are mandatory:
VAMP_KEY_VALUE_STORE_TYPE <=> confd -backendVAMP_KEY_VALUE_STORE_CONNECTION <=> confd -nodeVAMP_KEY_VALUE_STORE_PATH <=> key used by confdVAMP_ELASTICSEARCH_URL <=> http://elasticsearch:9200
Example:
docker run -e VAMP_KEY_VALUE_STORE_TYPE=zookeeper \
-e VAMP_KEY_VALUE_STORE_CONNECTION=localhost:2181 \
-e VAMP_KEY_VALUE_STORE_PATH=/vamp/gateways/haproxy/1.6 \
-e VAMP_ELASTICSEARCH_URL=http://localhost:9200 \
magneticio/vamp-gateway-agent:katana
Available Docker images can be found at Docker Hub.
Domain name resolver
To enable dnsmasq to resolve virtual hosts, pass the following environment variables to the Docker container:
VAMP_VGA_DNS_ENABLESet to non-empty value to enableVAMP_VGA_DNS_PORTListening port, default: 5353
Building Docker images
make targets:
version- displaying version (tag)clean- removing temporal build directory./targetpurge- runningcleanand removing all imagesmagneticio/vamp-gateway-agent:*build- copying files to./targetdirectory and building the imagemagneticio/vamp-gateway-agent:${version}default-clean build