{"__v":1,"_id":"56f43eb36042120e00032284","category":{"__v":2,"_id":"56ccf29a431ada1f00e85aae","pages":["56ccf3498c4a331d002c1e1e","56ccf35a8c4a331d002c1e21"],"project":"55c6bec1b9aa4e0d0016c2c3","version":"55c6bec1b9aa4e0d0016c2c6","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-24T00:00:26.717Z","from_sync":false,"order":4,"slug":"code-labs","title":"Code Labs"},"parentDoc":null,"project":"55c6bec1b9aa4e0d0016c2c3","user":"56e1901aa71e9e200066cdf6","version":{"__v":8,"_id":"55c6bec1b9aa4e0d0016c2c6","project":"55c6bec1b9aa4e0d0016c2c3","createdAt":"2015-08-09T02:45:21.683Z","releaseDate":"2015-08-09T02:45:21.683Z","categories":["55c6bec2b9aa4e0d0016c2c7","56c14bc5826df10d00e82230","56cceed8723ad71d00cae46c","56ccf29a431ada1f00e85aae","56ccf3c28fa8b01b00b82018","56ce1e6ee538330b0021ac5d","56f97e9a4c612020008f2eaf","5734fafd146eb82000597261"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["5759fcbb8b5e3e2000c0d28c"],"next":{"pages":[],"description":""},"createdAt":"2016-03-24T19:23:31.964Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"> **NOTE:** _Kubernetes:_ The following example pipeline is predicated on running a VM based deployment solution (e.g. AWS, GCP). Comprehensive documentation of pipeline configuration for Kubernetes is incoming, as it is slightly different for container based solutions.\n\nTo 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.\n\nNote 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.\n\n### Create a Spinnaker application\n\n1. In Spinnaker, click **Actions** > **Create Application**\n  1. Input <code>example</code> for the **Name** field and your email address for\nthe **Owner Email** field.\n2. Click inside of the dashed rectangle beside the **Accounts** heading.\n  * Click <code>my-aws-account</code> if you are deploying to AWS or\n<code>my-google-account</code> if you are deploying to GCP.\n3. Click on the **Consider only cloud provider health when executing\n  tasks** button next to **Instance Health**.\n4. Click the **Create** button.\n\n### Create and configure a security group\n\nNext, you'll create a security group that specifies traffic firewall\nrules for the cluster. You'll configure the firewall rules to allow\nall incoming traffic on port 80, for clusters associated with this\nsecurity group.\n\n1. Click **SECURITY GROUPS**, then click the **+** button to create a security group.\n2. Input <code>test</code> for the **Detail (optional)** field and\n<code>Test environment</code> for the **Description** field.\n3. If running on AWS\n  * Select **defaultvpc** as the **VPC** field\n  * Click **Add new Security Group Rule**.\n  * Click **default** on the **Security Group** dropdown.\n  * Change **Start Port** and **End Port** to <code>80</code>.\n4. If running on GCP\n  * Click **Add New Source CIDR** and use the default\n    <code>0.0.0.0/0</code> value for the **Source Range** field.\n  * Click **Add New Protocol and Port Range**. Use the default\n  <code>TCP</code> value for the **Protocol** field. Change **Start\n  Port** and **End Port** to <code>80</code>.\n5. Click the **Create** button.\n\n### Create a load balancer\n\nNext, you'll create a load balancer in Spinnaker.\n\n1. Click **LOAD BALANCERS**, then click the **+** button to create a load balancer.\n2. Input <code>test</code> for the **Stack** field.\n3. If running on AWS, select **internal (defaultvpc)** from the **VPC\n  Subnet** dropdown.\n4. Click the **Next** button.\n5. If running on AWS\n  * Select **example-test** from the **Security Groups** dropdown.\n  * Hit **Next**, then **Create**.\n6. If running on GCP\n  * Deselect the **Enable health check?** checkbox.\n7. Click the **Create** button.\n\n### Create a deployment pipeline\n\nYour final task is to set up a Spinnaker pipeline. Let's name it\n**Bake & Deploy to Test**. The pipeline will produce an image\ncontaining the <code>redis-server</code> package and then deploy\nit. In this tutorial, you'll trigger the pipeline manually.\n\nTo create the pipeline:\n\n1. Click **PIPELINES**, then click **Configure** and select **Create\n  New...** from the dropdown.\n2. Input <code>Bake & Deploy to Test</code> for the **Pipeline Name**.\n3. Click the **Create Pipeline** button.\n\n#### Set up the first stage of the pipeline\n\nYou're now going to create the first stage of the pipeline. It will\nbuild an image from an existing redis-server package.\n\n1. Click **Add stage**.\n2. Select **Bake** from the **Type** pulldown menu.\n3. Input <code>redis-server</code> for the **Package** field.\n4. Click **Save Changes**.\n\n#### Set up the second stage of the pipeline\n\nYou're now going to set up the second stage of the pipeline. It takes\nthe image constructed in the *Bake* stage and deploys it into a test\nenvironment.\n\n1. Click **Add stage**.\n2. Select **Deploy** from the **Type** dropdown.\n3. Under the **Server Groups** heading, click **Add server group**.\n4. Click the **Continue without a template** button.\n\nNext, In the **Configure Deployment Cluster** window, input \"test\"\nfor the **Stack** field.\n\n6. If running on AWS, select **defaultvpc** under **VPC Subnet**.\n7. Click the **Next** button.\n8. Click the text area next to the **Load Balancers** heading, then\n  select <code>example-test</code>. Click the **Next** button.\n9. Click the **Security Groups** form field, then click\n  <code>example-test (example-test)</code>. Click the **Next**\n  button.\n10. If running on AWS\n  * Click on the **Micro Utility** button to set the **Instance\n    Profile**, then click **Next**.\n  * Select the **Medium: m3** size, then click **Next**.\n11. If running on GCP\n  * Click on the **Micro Utility** button to set the **Instance\n    Profile**, then click **Next**.\n  * If running on GCP, select the **Micro** size, then click **Next**.\n12. Input <code>2</code> for the **Number of Instances** field, then click the\n  **Add** button.\n13. Save the pipeline configuration by clicking the **Save Changes**\n  button.\n\n### Try it out!\n\n1. Click **PIPELINES** in the navigation bar.\n2. Click **Start Manual Execution** for the **Bake & Deploy to Test**\n  pipeline.\n3. Click **Run**.\n\nNow, watch Spinnaker in action. A **MANUAL START** section will\nappear, and will show progress as the pipeline executes. At any point\nduring pipeline execution, click on the horizontal bar to see detailed\nstatus for any of the stages in the pipeline.\n\nFeel free to navigate around the Spinnaker menus, create new\npipelines, clusters, server groups, load balancers, and security\ngroups, etc. and see what happens.\n\nWhen you're ready to stop, don't forget to cleanup your resources. An\neasy way to do this is to visit the pipelines, clusters, load\nbalancers, and security groups pages, click on the ones created and\nselect the appropriate **Delete** command from the Actions pulldown on\nthe right.","excerpt":"","slug":"bake-and-deploy-pipeline","type":"basic","title":"Bake and Deploy Pipeline"}

Bake and Deploy Pipeline


> **NOTE:** _Kubernetes:_ The following example pipeline is predicated on running a VM based deployment solution (e.g. AWS, GCP). Comprehensive documentation of pipeline configuration for Kubernetes is incoming, as it is slightly different for container based solutions. 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. ### Create a Spinnaker application 1. In Spinnaker, click **Actions** > **Create Application** 1. Input <code>example</code> for the **Name** field and your email address for the **Owner Email** field. 2. Click inside of the dashed rectangle beside the **Accounts** heading. * Click <code>my-aws-account</code> if you are deploying to AWS or <code>my-google-account</code> if you are deploying to GCP. 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 security group Next, you'll create a security group that specifies traffic firewall rules for the cluster. You'll configure the firewall rules to allow all incoming traffic on port 80, for clusters associated with this security group. 1. Click **SECURITY GROUPS**, then click the **+** button to create a security group. 2. Input <code>test</code> for the **Detail (optional)** field and <code>Test environment</code> for the **Description** field. 3. If running on AWS * Select **defaultvpc** as the **VPC** field * Click **Add new Security Group Rule**. * Click **default** on the **Security Group** dropdown. * Change **Start Port** and **End Port** to <code>80</code>. 4. If running on GCP * Click **Add New Source CIDR** and use the default <code>0.0.0.0/0</code> value for the **Source Range** field. * Click **Add New Protocol and Port Range**. Use the default <code>TCP</code> value for the **Protocol** field. Change **Start Port** and **End Port** to <code>80</code>. 5. 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 <code>test</code> 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 **Security Groups** dropdown. * Hit **Next**, then **Create**. 6. If running on GCP * Deselect the **Enable health check?** checkbox. 7. 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 <code>redis-server</code> 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 <code>Bake & Deploy to Test</code> 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 <code>redis-server</code> 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. 6. If running on AWS, select **defaultvpc** under **VPC Subnet**. 7. Click the **Next** button. 8. Click the text area next to the **Load Balancers** heading, then select <code>example-test</code>. Click the **Next** button. 9. Click the **Security Groups** form field, then click <code>example-test (example-test)</code>. Click the **Next** button. 10. 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**. 11. 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**. 12. Input <code>2</code> for the **Number of Instances** field, then click the **Add** button. 13. 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 security groups, 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 security groups pages, click on the ones created and select the appropriate **Delete** command from the Actions pulldown on the right.