Janitor is a general purpose Proxy with additional abilities like Service Discovery and Load Balance. It was designed to expose services with multiple tasks directly to end user or use behind other tool like Nginx, HAProxy or even H5.
For the time present Janitor can load a upstream with multiple
targets that stored in Consul and expose it with a specified port on the very host that Janitor was deployed.
- Automaticlly bind or release port for a service base on information that store in Consul
- Proxy HTTP requests to backend upstreams
- Load balance requests with Round Robin, with more coming in the short future.
make
- below is the service struct stored in Consul
curl -XGET yourconsuladdr:8500/v1/catalog/service/mesos
{
"Address": "192.168.1.103",
"Node": "foobar",
"ServiceAddress": "192.168.1.103",
"ServiceID": "mesos",
"ServiceName": "mesos",
"ServicePort": 5100,
"ServiceTags": [
"borg",
"borg-frontend-proto:http",
"borg-frontend-port:3412"
]
}
make sure ServiceTags follow the conventions
borgindicates current service is a valid upstreamborg-frontend-proto:httpthe protocol of this upstreamborg-frontend-port:3412the port number of this upstream
-
Upstreamor more commonly aService, is a tuple of {ServiceName, Port, Proto} -
Targetupstream have multiple targets, underlaying is a mesos tasks.
Fork it and make a PR