In all Chef examples that I've seen autoscaling works pretty easy - you provision something like DB host, then web servers. You can create as many webservers as you like - all of them are going to use the same DB host (no changes required).
But what if my recipe/node provisioning cookbook requires configuration changes on some other backend nodes? How I can do it with Chef? For example, I have existing BGP route reflector (bird), I provision new bird edge node and, as a dependency, I have to generate new iBGP peer config and reread config file on the BGP route reflector node.
What is the best practice? Should I use chef-push-jobs to push changes to BGP route-reflector nodes?
Chef doesn't really have a system for this internally. In the broad strokes, what you are talking about is "service discovery", when one service wants to find out information about another service on the network. Chef has a simple SD system in it via the
search()
API, but there are also dedicated SD systems like Consul, Eureka, and mDNS/Autoconf.Once you have the service data in a way that it can be accessed, the next question is how to deal with updates spreading through a network. Chef on its own generally uses a daemon-mode service running a converge every X seconds. That would mean that if you set X to 60, then after 119 seconds everything would be updated. If you want something faster then there are options like pushing notifications from one node to another or using a central orchestration system to push both the original change and then deal with cascade updates. Chef Push Jobs is theoretically usable here but I wouldn't really recommend it. Something like Consul + Consul Templates is probably what you want for fast-churn configuration and SD updates, or just let Chef's interval runs take care of it for things that change less often.