Bake and Deploy Pipeline

Set up a Spinnaker pipeline that bakes a VM image containing Redis, then deploys that image to a test cluster.

VM only: This codelab requires you have a VM (for example, on AWS or GCP) on which to run it.

For Kubernetes, try Kubernetes Source-to-Prod , or this one, for Azure .

To walk you through some of the basics with Spinnaker, you’re going to set up a Spinnaker pipeline that bakes a virtual machine (VM) image containing redis, then deploys that image to a test cluster.

Note here that the us-east-1a availability zone is currently full, so it will need to be deselected in the corresponding ‘region’ checkbox list for each of these steps.

Set up Spinnaker

If you don’t already have a running Spinnaker instance, you’ll need to set one up before you continue. A demo installation should be sufficient for this codelab, but you can also follow the full setup guide to try out Spinnaker with a full installation.

Once you have deployed Spinnaker, navigate to localhost:9000 to start this codelab.

Create a Spinnaker application

  1. In Spinnaker, click Actions > Create Application
  2. Input example for the Name field and your email address for the Owner Email field.
  3. Click on the Consider only cloud provider health when executing tasks button next to Instance Health.
  4. Click the Create button.

Create and configure a firewall

Next, you’ll create a firewall that specifies traffic rules for the cluster. You’ll configure the rules to allow all incoming traffic on port 80, for clusters associated with this firewall.

  1. Click FIREWALLS, then click the + button to create a firewall.
  2. Input test for the Detail (optional) field and Test environment for the Description field.
  3. If running on AWS
  • Select defaultvpc as the VPC field
  • Click Add new Firewall Rule.
  • Click default on the Firewall dropdown.
  • Change Start Port and End Port to 80.
  1. If running on GCP
  • Click Add New Source CIDR and use the default 0.0.0.0/0 value for the Source Range field.
  • Click Add New Protocol and Port Range. Use the default TCP value for the Protocol field. Change Start Port and End Port to 80.
  1. Click the Create button.

Create a load balancer

Next, you’ll create a load balancer in Spinnaker.

  1. Click LOAD BALANCERS, then click the + button to create a load balancer.
  2. Input test for the Stack field.
  3. If running on AWS, select internal (defaultvpc) from the VPC Subnet dropdown.
  4. Click the Next button.
  5. If running on AWS
  • Select example-test from the Firewalls dropdown.
  • Hit Next, then Create.
  1. If running on GCP
  • Deselect the Enable health check? checkbox.
  1. Click the Create button.

Create a deployment pipeline

Your final task is to set up a Spinnaker pipeline. Let’s name it Bake & Deploy to Test. The pipeline will produce an image containing the redis-server package and then deploy it. In this tutorial, you’ll trigger the pipeline manually.

To create the pipeline:

  1. Click PIPELINES, then click Configure and select Create New… from the dropdown.
  2. Input Bake & Deploy to Test for the Pipeline Name.
  3. Click the Create Pipeline button.

Set up the first stage of the pipeline

You’re now going to create the first stage of the pipeline. It will build an image from an existing redis-server package.

  1. Click Add stage.
  2. Select Bake from the Type pulldown menu.
  3. Input redis-server for the Package field.
  4. Click Save Changes.

Set up the second stage of the pipeline

You’re now going to set up the second stage of the pipeline. It takes the image constructed in the Bake stage and deploys it into a test environment.

  1. Click Add stage.
  2. Select Deploy from the Type dropdown.
  3. Under the Server Groups heading, click Add server group.
  4. Click the Continue without a template button.

Next, In the Configure Deployment Cluster window, input “test” for the Stack field.

  1. If running on AWS, select defaultvpc under VPC Subnet.
  2. Click the Next button.
  3. Click the text area next to the Load Balancers heading, then select example-test. Click the Next button.
  4. Click the Firewalls form field, then click example-test (example-test). Click the Next button.
  5. If running on AWS
  • Click on the Micro Utility button to set the Instance Profile, then click Next.
  • Select the Medium: m3 size, then click Next.
  1. If running on GCP
  • Click on the Micro Utility button to set the Instance Profile, then click Next.
  • If running on GCP, select the Micro size, then click Next.
  1. Input 2 for the Number of Instances field, then click the Add button.
  2. Save the pipeline configuration by clicking the Save Changes button.

Try it out!

  1. Click PIPELINES in the navigation bar.
  2. Click Start Manual Execution for the Bake & Deploy to Test pipeline.
  3. Click Run.

Now, watch Spinnaker in action. A MANUAL START section will appear, and will show progress as the pipeline executes. At any point during pipeline execution, click on the horizontal bar to see detailed status for any of the stages in the pipeline.

Feel free to navigate around the Spinnaker menus, create new pipelines, clusters, server groups, load balancers, and firewalls, etc. and see what happens.

When you’re ready to stop, don’t forget to cleanup your resources. An easy way to do this is to visit the pipelines, clusters, load balancers, and firewalls pages, click on the ones created and select the appropriate Delete command from the Actions pulldown on the right.

Last modified May 4, 2021: rest of migration (700781a)