This is the repo for deploying a Sputnik demo. I can make a change!
This repository contains the roles, environments and data bags for deploying an Sputnik laptop demonstration application.
There is also a Spiceweasel (http://bit.ly/spcwsl) manifest documenting all the community cookbooks, roles, data bags and environments required for this demo.
For the cloud provider, you may need development versions of Ohai if running on an OpenStack cloud and the trunk release of knife-rackspace if using Rackspace V2.
The apt
cookbook is currently from https://github.com/mattray/apt/tree/COOK-1875 but should be released shortly.
To see the commands necessary to push all of the files to the Chef server, run the following command:
spiceweasel infrastructure.yml
To actually deploy the repository to your Chef server, run the following command:
spiceweasel infrastructure.yml | sh
- Configure the Sputnik laptop for lxc and apt-cacher-ng with the
sputnik-base
Role. - Launch an
haproxy
node on lxc in thesputnik
Environment. - Launch 2
demo-app
nodes on lxc in thesputnik
Environment. - knife ssh "role:haproxy AND chef_environment:sputnik" "chef-client"
- Connect to the
haproxy
node insputnik
on port 22002 to see the web UI console. - Connect to the
haproxy
node insputnik
on port 80 to see thedemo-app
, refresh a couple of times. - Launch an
haproxy
node in the cloud in theproduction
Environment. - Launch 2
demo-app
nodes in the cloud in theproduction
Environment. - knife ssh "role:haproxy AND chef_environment:production" "chef-client"
- Connect to the
haproxy
node inproduction
on port 22002 to see the web UI console. - Connect to the
haproxy
node inproduction
on port 80 to see thedemo-app
, refresh a couple of times. - Bump up the version number of the
demo-app
cookbook in themetadata.rb
. - Make a change to the
demo-app
cookbook. - knife cookbook upload
demo-app
- knife ssh "recipe:demo-app" "chef-client"
- Connect to the
haproxy
node inproduction
on port 80 to see thedemo-app
, refresh a couple of times. Nothing happens because we pinned the cookbook version. - Update the
sputnik
environment to use the new version of thedemo-app
cookbook. - knife environment from file sputnik.rb
- knife ssh "recipe:demo-app AND chef_environment:sputnik" "chef-client"
- Connect to the
haproxy
node insputnik
on port 80 to see the newdemo-app
, refresh a couple of times. - Fire up 10 more
demo-app
boxes in theproduction
environment. - Update the
sputnik
environment to use the new version of thedemo-app
cookbook. - knife ssh "chef_environment:production" "chef-client"
- Connect to the
haproxy
node inproduction
on port 22002 to see the web UI console. - Connect to the
haproxy
node inproduction
on port 80 to see thedemo-app
, refresh a couple of times.
The environments in this repo lock the versions of the cookbooks and override attributes used to differentiate sputnik
laptop development environment from the production
environment.
Recipes for every machine deployed. Attempts to use apt::cacher-client
.
Sets up the Sputnik laptop with lxc
and apt-cacher-ng
(for use by the lxc VMs).
The demo application sits behind the software load balancer haproxy
.
With the exception of the demo-app
cookbook, the cookbooks used by this repository are all
Trivial html page behind apache2
that renders the names of the machines to demonstrate the haproxy
integration.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.