Chef Solo was the original Chef. Remember the bad old days before the Chef server existed as a product, and the only way to use Chef was to scp (or worse, ftp) giant tarballs of recipes & cookbooks from system to system?
Five years later, we not only have a robust & scalable Chef server, but we have a Chef client that can run in local mode in addition to client-server mode. Chef Client local mode emulates all the functionality of Chef Solo, so it’s finally time to send chef-solo to the rural sanctuary for retired command-line tools.
What Is Chef Zero?
In late 2012, Chef Zero was created as a lab exercise by Chef software engineer John Keiser. (The term “lab” might be a bit misleading for what actually happened, which is an entertaining story in its own right. Suffice it to say that Black Friday is good for software development activities here at Chef.)
Chef Zero is a full, in-memory, fast-start Chef server intended for development purposes; it persists no data to disk, nor does it have any authentication or authorization. Later, Chef Zero was rolled into Chef Client 11.8.0, thereby giving us Chef Client local mode, which you run with the --local-mode parameter to chef-client.
Local mode behaves exactly like Chef Solo except that, during a run, it starts up a local Chef Zero server bound to localhost, uploads all local cookbooks & recipes to it, runs Chef Client, and then terminates the Chef Zero server. The end user experience is identical to Solo.
Why Migrate from Solo to Local Mode?
If you’re still using Solo, there are a number of compelling reasons to move to Chef Client local mode.
if Chef::Config[:solo] # do something else # do something else end
This also makes testing your recipes easier, because you have one less code path to maintain. Test Kitchen already supports chef_zero as a provisioner; simply change chef_solo to chef_zero in your .kitchen.yml and you’re in business.
Client-server mode also gives you many other compelling features, like:
and many others.
Some customers go directly to the client-server mode, which is great; it remains our recommended, and most widely-deployed architecture. If you’re not quite ready, local mode meets your standalone needs while putting you on an easy migration path to client-server.
Although we have no immediate plans to deprecate Chef Solo, we will eventually remove it from Chef. Hopefully I’ve made the case for you to start switching your deployments at least from solo to local mode. And if you’re just starting to play with Chef, start with chef-apply, or local mode, rather than Solo.