Recently, Target posted a blog about our work with Spinnaker and a friend of mine asked what makes Spinnaker better than all the alternatives. First, lets dispense with the disclaimers. One, this are my views and opinions, not those of my employer, Target. Two, I started working on the project–hired at Target–after Spinnaker was chosen as the deployment too, so I was not part of the evaluation. Three, I am new the DevOps world. Most of my experience is as an application developer with some ops experience in the form of manually or semi-automatically deploying applications through custom Bash scripts.
So, what makes Spinnaker special? It isn’t hard to deploy an application to Amazon, Google Cloud, or even Kubernetes. What is hard is managing a dozen apps in a dozen environments. Let us say you wanted to make a movie streaming website. To make development easier, your website is made up of several apps. You have an app to stream the actual videos, an app to browse videos, a ratings app, a recommendation app, and a dozen more apps that I can’t think of. Now, before you deploy to production, you want to deploy to staging. And before you deploy to staging. When you deploy to production, you want to do so without a service interruption, so you do green-blue deployments.
This is where Spinnaker shines. For each service, you create a pipeline that is triggered by a clean build in Jenkin. It will then bake an image with the app installed on it, deploy the app automatically to a dev environment. The app comprised the necessary load balancers, security group rules, and an auto scaling group–I am using AWS terminology here for the application to run. Then you can create additional pipelines that allows you to manually promote a service from dev to staging. Finally, that service can be promoted to production.
When deploying to dev or staging, you may be OK with a service interruption. Cloud providers are expensive and running duplicate dev and staging environments, even for a short period of time may be expensive. Spinnaker has a deployment strategy to disable or destroy an existing cluster before deploying the next. Production is a different story. You may decide the cost of a duplicate cluster is acceptable so you can just flip the switch to the new one before tearing down the older cluster. Spinnaker handles this through blue-green deployments. Though Spinnaker calls them red-black.
Another benefit of Spinnaker is that it supports multiple cloud providers. It can be configured to deploy to AWS, GCE, Kubernetes, and soon, OpenStack. On top of that, it can be configured to use multiple accounts in each provider. This means dev and staging can be deployed to different accounts than production.