Basics

Setup a basic pipeline in order to deploy a simple frontend application

Through the next few exercises, we'll setup the deployment on development environment of an application which display a wonderful page.

Create the Pipeline

Head to the "Pipeline" tab:

  • click "configure a new pipeline"

  • enter the pipeline name "deploy-dev"

  • click the "Create" button

You created an empty pipeline named "deploy-dev".

This page is the configuration stage of the pipeline: every pipeline start with this stage. We will get back to the configuration stage later, for now let's add a new stage.

Service stage

Add a new stage:

  • click the "Add stage" grey button

  • select the "Deploy (Manifest)" type

  • select the Kubernetes account Spinnaker will use in order to deploy the manifest (only one choice should be available)

  • paste the following YAML file in the "Manifest" section

  • replace ${account} with your actual account name (provided at the beginning of this lab: ie "batman", "superman", and so on...)

  • name the stage "Deploy Service"

  • save your changes (bottom right corner)

This manifest configures a Kubernetes Servicearrow-up-right which allows other applications to access the wonderfulapp's pods. The following diagram, from the Kubernetes documentation on the CoreOS websitearrow-up-right, shows how the service select the pods which will receive traffics according to their labels.

Ingress stage

Now, we need to add a new step in order to deploy the application's Ingress rule:

  • click the "Add stage" grey button

  • select the "Deploy (Manifest)" type

  • select the Kubernetes account spinnaker will use in order to deploy the manifest (only one choice should be available)

  • paste the following YAML file in the "Manifest" section

  • replace ${account} with your actual account name

  • name the stage "Deploy Ingress"

  • save your changes (bottom right corner)

This manifest describes an Ingress rulearrow-up-right used by the cluster's Ingress Controllerarrow-up-right in order to route incoming traffic to the right Service, which in turn will route traffic to the right pods.

ReplicaSet stage

Finally, we need to add a last step in order to deploy the application's pods:

  • click the "Add stage" grey button

  • select the "Deploy (Manifest)" type

  • select the Kubernetes account spinnaker will use in order to deploy the manifest (only one choice should be available)

  • paste the following YAML file in the "Manifest" section

  • replace ${account} with your actual account name

  • name the stage "Deploy ReplicaSet"

  • save your changes (bottom right corner)

We defined a Kubernetes ReplicaSetarrow-up-right in order to manage our pods, thus all operations on pods (scaling up/down, updating, etc...) will be handled by this manifest.

Run the Pipeline

You should now have a pipeline resembling this:

Save your changes and go back to the Pipeline tab: you should see your pipeline named "deploy-dev". Click the button "Start manual execution".

After a few seconds, your pipeline execution completes.

Take a moment to click on each step and play with the pipeline results output.

Go to the "Infrastructure" tab : a new Cluster Group has been created, as well as a new Load Balancer (in Spinnaker terms, not Kubernetes).

Go to the Load Balancers tab (just below "Infrastructure"). You can see both the Ingress rule and the Service:

You can find the URL of your cluster here:

  • click on the Ingress

  • the right menu appears

  • copy the address displayed under the label "Ingress": this is the publicly accessible URL of your cluster.

You should be able to access the application at http://${clusterURL}/${account}/wonderfulapp.

Summary

Our Pipeline ensure new pods won't be deployed if an error occurs during the Ingress/Service stage: using Pipelines, we are able to coordinate deployment stages which depends on each other completion status.

Last updated