- From: Seth Falcon <
>
- To:
- Cc:
- Subject: [chef] Re: Serial deployment
- Date: Wed, 3 Nov 2010 13:04:32 -0700
Hi Rob,
On Tue, Nov 2, 2010 at 10:38 AM, Rob Guttman
<
>
wrote:
>
We're just starting to use chef for managing nagios configs - so far, so
>
good.
Nice :-)
>
What we would like to eventually use it for is to deploy all of our web apps
>
and services. A specific use case we have is to be able to *serially*
>
deploy to hosts/instances within a cluster behind a load balancer. For
>
example, we would take one host out of rotation, deploy to it, warm it up
>
and/or smoke test, and when warming completes and/or if smoke tests pass
>
then put it back into rotation and move on to the next host in the cluster.
>
>
How best to achieve that?
Right now there isn't any automated tooling to support this sort of
deployment orchestration, but chef makes this fairly easy to manage in
a by-hand fashion.
Suppose you had a role for your app. A first pass at serial deploy
would be:
0. Update data bag or role describing what version should be deployed.
1. Login to load balancer, take server 1 out of config, restart
2. Run chef-client on server 1. Test it. Put it in rotation and take
out server 2.
[now repeat for each remaining server]
You could go a bit further by having the recipe that generates the
load balancer config check for an "active" attribute:
web_apps = search(:node, "role:myapp AND active_app:true")
Then you could take a node out of rotation by editing the node with
knife, setting active_app:false, and running chef-client on the
load-balancer. You could also use this attribute to decide where to
deploy next:
knife ssh 'role:myall AND active_app:false' sudo chef-client
If you decide to experiment with this approach, you should be aware
that there is some lag (about 1 minute on the Opscode Platform)
between saving a node and being able to search for updated attribute
values.
+ seth
Archive powered by MHonArc 2.6.16.