1.0.0.M3

Copyright © 2016

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Spring Cloud Spinnaker Documentation

This section provides a brief overview of Spring Cloud Spinnaker reference documentation. Think of it as map for the rest of the document. You can read this reference guide in a linear fashion, or you can skip sections if something doesn’t interest you.

About the documentation

The Spring Cloud Spinnaker reference guide is available as html and pdf documents. The latest copy is available at docs.spring.io/spring-cloud-spinnaker/docs/current/reference.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

Getting started

Interested in deploying applications to the cloud with complex rollouts, sophisticated notifications (Slack, Email, etc.)? Then this document is for you. It will coach you on using this application to install Spinnaker.

Introducing Spring Cloud Spinnaker

cf cert landscape color

Spinnaker is a multi-cloud continuous deployment platform released by Netflix with contributions from Pivotal, Google, Microsoft and others. Spring Cloud Spinnaker is an installation tool meant to gather all the necessary information and use it to deploy Spinnaker’s microservices into a certified Cloud Foundry installation.

It installs the follow Spinnaker components:

Table 1. Spinnaker modules
Module Purpose

clouddriver

Carries out all cloud-based operations, e.g. deploy, resize, destroy, etc.

deck

Frontend UI

echo

Sends messages out over various channels like Slack and email

front50

Manages long term and inflight data, e.g. pipeline definitions and currently running pipelines

gate

Gateway API between the frontend (deck) and the backend services

igor

Polls for CI job status, e.g. Jenkins and Travis

orca

Orchestration engine used for all operations and pipelines

Spinnaker has other modules, but they aren’t needed for a Cloud Foundry setup. For example, there is a module dedicate to wrapping JAR artifacts as Amazon AMIs, also known as "baking", but Cloud Foundry doesn’t need baking.

Before installing Spinnaker

Before you actually install Spinnaker, you must decide where it will run, i.e. pick an organization and space. You also need the following services created as well:

  • An instance of Redis in the same space. You will need the name of this service later on when you enter all your settings.

Installing Spinnaker

Composed of Boot-based microservices, Spinnaker is highly customizable. However, instead of trying to get in and tune ever single setting, Spring Cloud Spinnaker lets you pick several options from the web page, and sets those properties for you.

To run it, you simply need the artifact pulled down from Artifactory.

You can either run it directly…​

$ java -jar spring-cloud-spinnaker-1.0.0.M3.jar

…​or install it in your instance of Cloud Foundry…​

$ cf push spring-cloud-spinnaker -p spring-cloud-spinnaker-1.0.0.M3.jar

Once hosted, you can navigate to the site and configure your Spinnaker settings.

Settings

After installing Spring Cloud Spinnaker, whether locally or in PCF somewhere, you will be faced with a collection of settings. This may look like a lot, but compared to ALL the options Spinnaker comes with, this is a vast simplification.

The settings are split into two parts: Target and Settings.

  • Target describes information needed to essentially "cf push" all the Spinnaker modules into PCF.

  • Settings is information used Spinnaker after installation for it to, in turn, install things on its own.

The following settings are needed to help install Spinnaker modules.

Table 2. Installation Settings
Setting Purpose

Target API

URL for the API where Spinnaker will be installed (In PWS, it’s api.run.pivotal.io)

Target Organization

Name of the organization you want Spinnaker installed in

Target Space

Name of the space you want Spinnaker installed in

Target Email

Email to log into CF and install Spinnaker

Target Password

Password to log into CF and install Spinnaker

Namespace

Optional suffix to apply to Spinnaker module names (test will yield clouddriver-test, etc.)

The following information is used by Spinnaker after installation for it to, in turn, install and manage things.

Table 3. Operations Settings
Setting Purpose

Redis Service

Name of the Redis service clouddriver, echo, front50, and orca must bind to

Default Org

Organization where Spinnaker will make deployments. This is pre-filled from Target Organization up above, but can be overridden. (Coming: Multiple organization support)

Default Space

Space where Spinnaker will make deployments. This is pre-filled from Target Space up above, but can be overridden. (Coming: Multiple space support)

Primary Account API

URL for the API where Spinnaker will make deployments. This is pre-filled from Target API up above, but can be overridden.

Primary Account Console

URL for App Manager (In PWS, it’s console.run.pivotal.io)

Account Name

Account name for Spinnaker to use when logging into PCF

Account Password

Account password for Spinnaker to use when logging into PCF

Repository Name/Access Code

If you are pulling deployment artifacts from an http-based repository, put your username. If s3, put your access code

NOTE: If your repository isn’t secured, leave blank

Repository Password/Secret Code

If you are pulling deployment artifacts from an http-based repository, put your password. If s3, put your secret code

NOTE: If your repository isn’t secured, leave blank

Spring Config Location

Override path location of your own set of Spinnaker configuration files.

Domain

Domain that Spinnaker will be installed into

Primary Account Name

Name of the account linked to the primary space

All Account Names

List of account names Spinnaker will interact with (separated by commas). This is pre-filled from Primary Account Name, but can be overridden.

With your settings filled in, click on the Status tab.

Deploying

On the Status tab, you have the ability to check each module, or deal with them all.

  1. Click on Deploy All.

  2. Sit back and sip on a cup of coffee. This will take some time.

Next Steps

After getting Spinnaker up and running, you should be able to access deck, the UI for Spinnaker, by visiting deck.<your domain>

Debugging Your Installation

Having trouble with your Spinnaker install? This section is meant to help you unravel things before you open a ticket.

Logs, logs, and more logs

When you are attempting to install Spinnaker, there are logs everywhere. The key is to find the right ones.

  • Spring Cloud Spinnaker can log information about the deployment process, but once completed, it doesn’t gather any more information

  • Each Spinnaker module will print out its own logs.

Assuming you installed Spinnaker with a namespace of "test", you can gather information like this…​

$ cf logs clouddriver-test

In another shell

$ cf restart clouddriver-test

If you watch the "cf logs" command, you should see your copy of clouddriver start up. If there’s a major issue, it should render an error, especially it it’s missing settings.

2016-09-06T11:32:31.91-0500 [API/0]      OUT Updated app with guid 39bc3f7b-ee7f-45f2-bac9-053069092c7a ({"state"=>"STARTED"})
2016-09-06T11:32:32.22-0500 [APP/0]      OUT Exit status 143
2016-09-06T11:32:32.25-0500 [CELL/0]     OUT Creating container
2016-09-06T11:32:32.25-0500 [CELL/0]     OUT Destroying container
2016-09-06T11:32:32.71-0500 [CELL/0]     OUT Successfully destroyed container
2016-09-06T11:32:33.02-0500 [CELL/0]     OUT Successfully created container
2016-09-06T11:32:39.29-0500 [CELL/0]     OUT Starting health monitoring of container
2016-09-06T11:32:44.71-0500 [APP/0]      OUT   .   ____          _            __ _ _
2016-09-06T11:32:44.71-0500 [APP/0]      OUT  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
2016-09-06T11:32:44.71-0500 [APP/0]      OUT ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2016-09-06T11:32:44.71-0500 [APP/0]      OUT  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
2016-09-06T11:32:44.71-0500 [APP/0]      OUT   '  |____| .__|_| |_|_| |_\__, | / / / /
2016-09-06T11:32:44.71-0500 [APP/0]      OUT  =========|_|==============|___/=/_/_/_/
2016-09-06T11:32:44.71-0500 [APP/0]      OUT  :: Spring Boot ::        (v1.2.8.RELEASE)
2016-09-06T11:32:44.85-0500 [APP/0]      OUT 2016-09-06 16:32:44.851  INFO 18 --- [           main] pertySourceApplicationContextInitializer : Adding 'cloud' PropertySource to ApplicationContext
...
...
2016-09-06T11:33:06.12-0500 [APP/0]      OUT 2016-09-06 16:33:06.126  INFO 18 --- [           main] s.d.spring.web.caching.CachingAspect     : Caching aspect applied for cache modelProperties with key com.netflix.spinnaker.clouddriver.model.Network(true)
2016-09-06T11:33:06.12-0500 [APP/0]      OUT 2016-09-06 16:33:06.126  INFO 18 --- [           main] s.d.spring.web.OperationsKeyGenerator    : Cache key generated: /vpcs.com.netflix.spinnaker.clouddriver.controllers.VpcController.list.DefaultGenericTypeNamingStrategy
2016-09-06T11:33:06.12-0500 [APP/0]      OUT 2016-09-06 16:33:06.126  INFO 18 --- [           main] s.d.spring.web.caching.CachingAspect     : Caching aspect applied for cache operations with key /vpcs.com.netflix.spinnaker.clouddriver.controllers.VpcController.list.DefaultGenericTypeNamingStrategy
2016-09-06T11:33:06.12-0500 [APP/0]      OUT 2016-09-06 16:33:06.126  INFO 18 --- [           main] s.w.ClassOrApiAnnotationResourceGrouping : Group for method list was vpc-controller
2016-09-06T11:33:06.12-0500 [APP/0]      OUT 2016-09-06 16:33:06.127  INFO 18 --- [           main] s.w.ClassOrApiAnnotationResourceGrouping : Group for method list was vpc-controller
2016-09-06T11:33:06.12-0500 [APP/0]      OUT 2016-09-06 16:33:06.127  INFO 18 --- [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: listUsingGET_10
2016-09-06T11:33:06.28-0500 [APP/0]      OUT 2016-09-06 16:33:06.282  INFO 18 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-09-06T11:33:06.28-0500 [APP/0]      OUT 2016-09-06 16:33:06.286  INFO 18 --- [           main] com.netflix.spinnaker.clouddriver.Main   : Started Main in 24.791 seconds (JVM running for 26.911)
2016-09-06T11:33:06.57-0500 [CELL/0]     OUT Container became healthy
  • In this console output, you can see that clouddriver is running with Spring Boot 1.2.8.RELEASE.

  • The "Started Main in 24.791 seconds" is the indicator that the app is finally up.

  • "Container became healthy" is the indicator that the platform can see the app as being up.

Environment settings

To apply various settings, Spring Cloud Spinnaker "cf pushes" the module and then applies various environment variables settings in Cloud Foundry. Pay note: it’s a LOT of settings. If you see a deployment either empty of environment variables or only containing SPRING_APPLICATION_JSON, then something has gone terribly wrong with the deployment.

clouddriver env vars
Figure 1. Sample of environment variables for clouddriver in the namespace of "spring"

Each of the services has a URL to reach the other relevant microservices. In this case, you can how it builds up the URL for clouddriver to speak to echo.

In this specific example:

  • service.echo.baseUrl = ${services.default.protocol}://${services.echo.host}${namespace}.${deck.domain}

  • services.default.protocol = https

  • services.echo.host = echo

  • namespace = -spring

  • deck.domain = cfapps.io

This allows the deployer to flexibly adjust each piece as needed.

Manually deploying Spinnaker

You may be tempted to simple grab the fat JARs for clouddriver, deck, etc. and push them yourself. Unfortunately, that’s not an option (yet).

  • Each module needs its own property file. clouddriver has clouddriver.yml, igor has igor.yml, etc. But they aren’t included in the JARs pulled from bintray. Netflix wraps each module in a Debian package and has those files in a different location. Spring Cloud Spinnaker grabs those JARs and dynamically inserts such files right before pushing to your Cloud Foundry instance.

Appendices