fabiolb / fabio

Consul Load-Balancing made simple
https://fabiolb.net
MIT License
7.25k stars 621 forks source link

Support for Consul and Vault Namespaces #810

Closed baabgai closed 3 years ago

baabgai commented 3 years ago

I'm trying to setup a multi-tenant consul cluster where each tenant corresponds to 1 consul namespace and I would like to use multiple fabio instances as load balancer per tenant. It would be great to be able to specify the consul namespace into which fabio can register itself and make this specific fabio instance only search routes within that specific namespace. Also fetching certificates from vault could be configured using namespaces in Vault. I could imagine using vault without namespaces in this setup and just use tenant specific paths to manage the certificates, but for consul integration I couldn't think of any workaround that would allow me to use fabio as described above.

I was searching for an option of the kind -registry.consul.namespace= but couldn't find any.

If there is not a current workaround to achieve this I would greatly appreciate any hints on how to get this to work. Otherwise it would really be great if such a namespace feature could be added in future fabio releases.

baabgai commented 3 years ago

I figured out that I should be able to achieve the desired effect using CONSUL_NAMESPACE and VAULT_NAMESPACE environment variables.