Adoptable Cookbooks List

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Usage

The easiest way to bootstrap a cluster is to use the cluster recipe
and use Chef provisioning which is a relatively new
extension. This extension allows you to use any driver and easily
stand up a cluster. Once the Chef Development Kit has been
installed you can run the following command to provision a cluster.

consul::default

The default recipe will install the Consul agent using the
consul::install_binary recipe. It will also configure and
start consul at the machine boot.

consul::install_binary

If you only wish to simply install the binary from the official
mirror you simply include consul::install_binary in your node's
run_list:

{
"run_list": [
"recipe[consul::install_binary]"
]
}

consul::install_source

Instead if you wish to install Consul from source you simply need
to include consul::install_source in your node's run_list. This
will also configure the Go language framework on the node to build
the application.

{
"run_list": [
"recipe[consul::install_source]"
]
}

consul::ui

Installing the separate Consul UI simply requires you to include
the consul::ui recipe in your node's run_list.

Removing service

Be sure to notify the Consul resource to restart when your service def changes.

Getting Started

To bootstrap a consul cluster follow the following steps:
0. Make sure that ports 8300-8302 (by default, if you configured different ones open those) UDP/TCP are all open.
1. Bootstrap a few (preferablly 3 nodes) to be your consul servers, these will be the KV masters.
2. Put node['consul']['servers'] =["Array of the bootstrapped servers ips or dns names"] in your environment.
3. Apply the consul cookbook to these nodes with node['consul']['service_mode'] = 'cluster' (I put this in this in a CONSUL_MASTER role).
4. Let these machines converge, once you can run consul members and get a list of all of the servers your ready to move on
5. Apply the consul cookbook to the rest of your nodes with node['consul']['service_mode'] = 'client' (I put this in the environment)
6. Start added services and checks to your cookbooks.
7. If you want to get values out of consul to power your chef, curl localhost:8500/v1/kv/key/path?raw in your cookbook.