ContainerShip & Chef

Norman Joyner
ContainerShip Articles
2 min readJan 19, 2016

--

A few months ago, our team released an article titled: Containers Vs. Config Management. In the piece, Phil Dougherty touched on how configuration management works, how containers work, and the advantages of each when automating your infrastructure. If you haven’t yet read that article, I encourage to do so now!

While we prefer leveraging full stack container management platforms as a replacement for configuration management tools, it is inevitable that some businesses may choose to stick with their existing toolsets for simplicity, or out of necessity (and that’s okay). This guide serves an introduction on how to get ContainerShip up and running utilizing Chef, rather than our ContainerShip Cloud provisioning tool. The containership cookbook will install and configure containership (and its dependencies) on your server. It will not handle application deployment, as that is something better left to ContainerShip itself. Let’s dive in!

You can grab the containership cookbook directly from the Chef Supermarket, and upload it to your Chef server. The cookbook is attribute-driven, and assumes some sensible defaults. The recommended way to interact with the cookbook is through the wrapper cookbook pattern. Utilizing this pattern will allow you to change the necessary node attributes before including the default containership recipe (example below).

include_recipe "containership::default"

In order to get nodes in a ContainerShip cluster to find one another, you can provide cidr ranges where containership will automatically perform discovery. To set these ranges you can set the cidr attribute as seen below:

While the above example configures a leader node, you can also configure follower nodes in a similar fashion:

It’s that simple! You will now have an open-source ContainerShip cluster stood up and configured through Chef. Since the navigator plugin is not installed by default, you will only have CLI & API access to your cluster. You can configure your local ContainerShip CLI tool to access the cluster as follows:

cs configure --api-url=http://leader.public.ip:8080

If you want to take advantage our ContainerShip Cloud SaaS offering, you can easily connect your open-source cluster by configuring the cloud plugin!

After you re-run chef-client your cluster will show up in the ContainerShip Cloud web-interface!

Open-source ContainerShip cluster connected to ContainerShip Cloud

Hopefully this walk-through on using Chef with ContainerShip is helpful for those looking to leverage configuration management, while reaping the benefits of a ContainerShip! Also remember that you can use Chef to set up ContainerShip on cloud providers we have not yet integrated with!

--

--