Previous Lab: Lab 4
Jump to TOC
Goal: Understand some of the features built into Spinnaker for safer deployments
In this lab, we're going to look at some manual and automated safeguards you can add to Spinnaker.
Manual Rollback
One of the more powerful features in Spinnaker is the ability to easily roll back a bad deployment in one step. Spinnaker can automatically roll back to a previous version if the version is still deployed but disabled.
-
Navigate to the clusters view and select your active
prod
server group -
Select
Server Group Actions
->;Rollback
-
Under
Restore To
, Select a previously disabled server group -
Click
Submit
Check out the Tasks
tab to see the specific steps Spinnaker took to roll back the cluster
Adding a manual judgment
Manual judgment is useful when you need to control authorization to specific accounts, or you want a human to judge whether or not something should proceed. You can put a custom message in the manual judgment text to give humans context to make decisions
-
Go to your
deploy to prod pipeline
and click onconfigure
-
Click on
Configuration
(the first graph node), thenAdd Stage
to add amanual judgment stage
Clicking onConfiguration
ensures the new stage is added at the beginning. -
Enter some text for the instructions for this manual judgment stage
-
Ensure
Propagate Authentication
is checked -
Make the stage run before the find image stage
-
On manual judgment stage, ensure there are no stages in the
Depends On
list -
In the find image stage, change the depends on field to add the
Manual Judgment
stage
-
-
Run your pipeline
-
In the manual judgment, select
stop
. See what happens -
Run your pipeline again, this time selecting
continue
as your manual judgment option
-
Add a deployment window
Deployment windows are really useful if you have automated triggers but want a pipeline to only run at specific times (like, only deploy to production during the workday).
-
Go to your
deploy to dev
pipeline -
Select the
deploy
stage -
Under the
Execution Options
header, check theRestrict execution to specific time windows
-
Click on
Add execution window
-
Select a time of day that is 5 hours from now
-
Save your pipeline
-
Go back to the executions screen and run your
deploy to dev
pipeline -
See how the execution window stops at the deploy stage
-
Mouse over the stage and click on
Skip remaining window
to start the pipeline immediately
-
-
Click on the blue bar (your running execution) to see the steps the pipeline is taking
-
Notice the
Restrict execution during time window
step that is already complete
Next Lab: Lab 6
Resources:
-
Safe Deployments Code Lab: https://www.spinnaker.io/guides/tutorials/codelabs/safe-deployments
-
Safer Deployment blog post: https://blog.spinnaker.io/can-i-push-that-building-safer-low-risk-deployments-with-spinnaker-a27290847ac4
-
Spinnaker Summit Videos
- Kayenta: Automated Canary Analysis - https://www.youtube.com/watch?v=LqquUa-IT28
- Canary Analysis at Netflix - https://www.youtube.com/watch?v=XB_En3bsUwM
- Automated Canary Analysis Panel - https://www.youtube.com/watch?v=JeAV1NBmU-Y