Using Spinnaker with Chef & Puppet

Feb 17, 2017 by Isaac Mosquera

Spinnaker takes a opinionated approach to deploying software. Well, Spinnaker doesn’t really deploy software, it deploys infrastructure. The concept is better known immutable infrastructure. When changes are needed in production, the old infrastructure is torn down or disabled and replaced by new sets of VMs, load balancers and sometimes databases. This approach gives you greater confidence in your deployments and gives you sophisticated features out of the box with Spinnaker like clean rollbacks and phased deployments.

While tools like Chef & Puppet aren’t necessarily opposed to this approach, typical implementations continue to re-use the same VMs as new version of the code you’re deploying packages are deployed. So while mutable and immutable don’t generally mix well, Spinnaker fortunately comes with a “Bake” stage. “Baking” is a concept where you begin with a base image, e.g. ubuntu, debian, rhel and you add your packages and configure the base image.

You can move your Chef & Puppet templates to the “Bake” stage of your Spinnaker pipeline. Behind the scenes it’s all just packer scripts. You can specify a package name that gets passed down to your packer template template. In this example we’re using armory-hello-deploy-chef as the package and aws-chef.json as the packer template. Note that aws-chef.json is a custom template and you will have to implement your own for your teams to use.

This will result in an AMI that contains your artifact and will be ready to go through the stages of deployment such as dev, stage, pre-production, production. During the deployment phases you can add environment specific user-data that will tell your app how to behave in that environment. For instance, where to find the staging db hostname vs production db hostname.

Since all bake stages must be preceded by a build stage (i.e. Jenkins) you’ll want to build an artifact if possible. This artifact (perhaps a tar or a zip file) that was generated should be the only thing that is passed to your template file if possible. It’s important to note that Spinnaker isn’t a dependency management tool for your software or machine configuration but more about lifecycle of your deployment and infrastructure.

This approach should get you started with Spinnaker and Immutable Infrastructure pretty quickly. Let us know if you have any more questions.

Learn More

Recently Published Posts

3 Common Spinnaker Challenges (and Easy Ways to Solve Them)

Sep 27, 2022

Spinnaker is the most powerful continuous delivery tool on the market.  DevOps engineers and developers recognize this power and are looking to use Spinnaker as a foundational tool in their Continuous Integration and Continuous Delivery (CI/CD) process for hybrid and multi-cloud deployments. Such a powerful, expansive open source tool needs expertise within your organization to […]

Read more

Streamline Advanced Kubernetes Deployments from GitHub Actions with New Armory Service

Sep 23, 2022

Today, Armory is excited to announce the availability of the GitHub Action for Armory Continuous Deployment-as-a-Service. GitHub is where developers shape the future of software. After a developer writes and tests their code in GitHub, it must be deployed. Armory’s GitHub Action for Continuous Deployment-as-a-Service extends the best-in-class deployment capabilities to Kubernetes. CD-as-a-Service enables declarative […]

Read more

When everyone is facing the same headwind, go on the offensive

Sep 12, 2022

Call me Pollyanna, but what a great time to be a Platform or DevOps engineer. If you’re working in a public company, the S&P is off ~20% year over year, so the value of your RSUs has wilted. If you’re working in a private company, venture funding and M&A velocity are anemic, making expansion capital […]

Read more