Your First Pipeline in Spinnaker

Create your first pipeline, which bakes an Amazon Machine Image (AMI).

What is a pipeline in Spinnaker?

The pipeline is the key deployment management construct in Spinnaker™. It consists of a sequence of actions, known as stages. You can pass parameters from stage to stage along the pipeline.

You can start a pipeline manually, or you can configure it to be automatically triggered by an event, such as a Jenkins job completing, a new Docker image appearing in your registry, a CRON schedule, or a stage in another pipeline.

Before you begin

This page assumes your application stack includes:

  • A Jenkins Master configured by your administrator
  • A Jenkins job that archives a Debian package
  • A security group within AWS with appropriate permissions
  • A Load Balancer

How to create a pipeline

This example creates a pipeline that takes the Debian package produced by a Jenkins job and uses it to create an Amazon Machine Image (AMI) before deploying that image to a server group.

  1. After selecting your Application, click the Pipelines category.

  2. On this page, click Configure a new pipeline.

  3. Provide a name for your new pipeline and click Create.

  4. On the Pipeline page you should see:

    • A visual representation of your pipeline and its stages (you should only have configurations at the beginning)
    • Execution Options
    • Automated Triggers
    • Parameters
    • Notifications
    • Description

Add a trigger

  1. Define how your pipeline is triggered. Scroll down to the Automated Triggers section and click Add Trigger. This section enables you to select a Type:

  2. For this example, select Jenkins. By adding a trigger, you are defining how your pipeline is initialized.

    Note: Property File is an important topic that will be covered in a separate guide.

  3. Before you test your pipeline, you may want to consider enabling or disabling the trigger via the checkbox at the bottom.

Add a Bake stage

  1. Now add your first stage: Baking an AMI. Click the Add stage button in the visual representations section:

  2. Select Bake from the Types drop down list.

  3. If you have multiple providers configured, select Amazon from the Provider drop down list. Next select the region or regions you want to bake in. In the Package field, enter the name of the package that your Jenkins job archived.

    • The package name should not include any version numbers. For example, if your build produces a deb file named “myapp_1.27-h343”, you would enter “myapp” here.
    • If you configure your own Base AMI under the Advanced Options, the Base OS configuration is ignored.

Add a Deploy stage

  1. Now add a Deploy stage by clicking Add stage again. Select Deploy In the Type drop down list. Deploy’s configuration settings should pop up on the screen.

    Note: If you want to reorganize the order that the stages execute in the pipeline, you can add or remove precursor stages in the Depends On field.

  2. In the Deploy Configuration section, click on the “Add server group” button. Pick your provider, if more than one is configured. This example uses AWS.

  3. Because this is a new application, do not choose to copy a configuration from a template. Press the Continue without a template button.

  4. It’s important to set up the correct Deploy Strategy for your use case. Use the Highlander strategy for this example, which will ensure that only one server group for your application exists at a time.

  5. In the Load Balancers section, select the load balancer you created before you began this tutorial.

  6. Select a security group that you are comfortable with, which will define the access rights to your resource.

  7. Select Instance Type as Micro Utility, then set the size as “small”.

  8. For Capacity, select how many instances you want in your server group. For our example, we will set it at 1.

  9. Click “add”. You will be brought back to your Application and see a new Deploy Configuration. Press “Save Changes” at the bottom right of your window.

Execute the Pipeline

  1. Click on the Pipelines option. You should see your new pipeline. Click on Start Manual Execution.

  2. You will be able to select a Build for your Jenkins job from a drop down menu. By default, Spinnaker will not recreate an AMI unless the underlying package has changed. If you would like to force it, you may use the checkbox for “Rebake”.

  3. Press “Run”, and you should see a progress bar where blue represents running and green represents complete. Gray represents not ran or canceled, which is not in our example picture.

    If your pipeline does not succeed, refer to one of the troubleshooting sections in the pipelines, baking, or deploying guides.

Note: Always remember to save your changes by clicking the button in the bottom right of the window.

Last modified October 17, 2023: (aa87b671)