Lukas Z's Private Blog

(mostly about programming)

Cooking With Chef

After having prepped our new server with KVM I decided to use Opscode Chef instead of installing everything by hand on each VM. There’s good and bad things to say about that.

First the good: It’s glorious.

I’ve set up a chef master server on the host-system and defined the two vms as nodes, and my laptop as the administrative client. Then I’ve downloaded some cookbooks (nginx, mysql, memached, and so forth) into my brand new chef git-repo and added the cookbooks to the run-lists of the nodes. A few minutes later the nodes were fully configured and I could deploy my apps with Capistrano - out of the box happiness.

All I had to do was write two more cookbooks myself to set up some more custom stuff like backups and search daemons.

For example now, if I need to change something in the nginx.conf I just edit the template in the cookbook, upload it to the chef-server and minutes later it is live on my nodes.

(By the way, the performance on the VMs is great. They say KVM will take about 10 - 20% off the performance as compared to running it on a non-VM environment, but due to the specs of the server it feels a lot faster than the old setup we’ve had.)

Now the bad things:

First of all, the documentation at opscode is bad. I mean, it is a lot of text covering many aspects of this rather complex software. But I always had the feeling that a) they make things more difficult than they are and b) they want to sell me hosted chef, a commercial hosted solution.

Now, b) is fair enough. They released a great product into the open source world and it’s fine that they want to make money off it. But still, the docs suffer from that focus.

Also, there’s a learning curve that I’d consider steep. Maybe it’s due to the bad documentation, but thinking in terms of Chef (and Puppet for that matter) takes a bit of getting used to. It took me a few days of reading and playing with it to figure it out. And I still haven’t used many of the features like Roles, Databags, the REST-API etc.

Furthermore, Chef makes more sense when running a highly distributed big application where inserting new nodes to the runtime configuration is a common chore. It’s like shooting with tanks on pigeons when only doing small things like our deployment. But it was a nice exercise to look into the subject so I’m happy I did it.

Finally:

The #chef irc-channel on freenode is a good place to go when having questions. There’s also some good tutorials on the basics if you search long enough. One place I’d recommend is DevOpsCasts.

Credits:

Thanks to Roland Moriz who has infected me with the awesomeness of Chef.

P.S.: You can follow me on Twitter.

Comments

Webmentions