fabiolb / fabio

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

Manual overrides: requesting extra information in documentation #364

Open nuriel77 opened 6 years ago

nuriel77 commented 6 years ago

I am trying to figure out how to configure manual route overrides. As far as I can understand, those have to be added to consul kv in /fabio/config ?

I am not sure how to add those? I tried querying consul i.e. consul kv get ./fabio/config consul kv get fabio/config consul kv get /fabio/config And none works. An example on how to add those would be very helpful. I am not sure if I am supposed to do something like: consul kv put /fabio/config .... ?

magiconair commented 6 years ago

You can go to http://localhost:9998/manual and set them there or use consul kv put fabio/config '#foo' for example. Please note that you can change the prefix in fabio.properties with registry.consul.kvpath

https://github.com/fabiolb/fabio/blob/master/fabio.properties#L531-L539

ghost commented 6 years ago

Just to add to this. We are updating the weighting of our microservices via consul.

we retrive the current value of fabio/config and then append to it using consul kv put fabio/config '#foo'.

My question is what is the best way to maintain the routing that has been added to the kv?

e.g. I update the weighting rules for service-a I update the weighting rules for service-b

service-a is no longer required and is removed from the environment. How would I tidy up the rules by removing service-a in fabio/config without affecting service-b? I didn't want to do this manually. I wanted it so that if service-a is un-deployed from an environment via a scripts, it would also tidy up the routing for that service too.

Is it possible that you could have fabio/config/service-a and fabio/config/service-b? so services are maintained separately? so when a microservice is terminated I can remove the kv entry just for that service