From edbc373109f06286a2aadd1688ad669a4f2619a5 Mon Sep 17 00:00:00 2001 From: Tanner Altares Date: Wed, 5 Feb 2020 14:14:13 -0600 Subject: [PATCH] add docs for manual rollback --- docs/gitbook/how-it-works.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/gitbook/how-it-works.md b/docs/gitbook/how-it-works.md index 7a6ad1e8..17381fbe 100644 --- a/docs/gitbook/how-it-works.md +++ b/docs/gitbook/how-it-works.md @@ -551,6 +551,9 @@ The canary promotion is paused until the hooks return HTTP 200. While the promotion is paused, Flagger will continue to run the metrics checks and rollout hooks. * Post-rollout hooks are executed after the canary has been promoted or rolled back. If a post rollout hook fails the error is logged. +* Rollback hooks are executed while a canary deployment is in either Progressing or Waiting status. +This provides the ability to rollback during analysis or while waiting for a confirmation. If a rollback hook +returns a successful HTTP status code, Flagger will rollback the canary deployment. * Event hooks are executed every time Flagger emits a Kubernetes event. When configured, every action that Flagger takes during a canary deployment will be sent as JSON via an HTTP POST request. @@ -584,6 +587,9 @@ Spec: timeout: 5s metadata: some: "message" + - name: "rollback gate" + type: rollback + url: http://flagger-loadtester.test/gate/halt - name: "send to Slack" type: event url: http://event-recevier.notifications/slack @@ -830,6 +836,10 @@ For manual approval of a canary deployment you can use the `confirm-rollout` and The confirmation rollout hooks are executed before the pre-rollout hooks. Flagger will halt the canary traffic shifting and analysis until the confirm webhook returns HTTP status 200. +For manual rollback of a canary deployment you can use the `rollback` webhook. The rollback hook will be called +during the analysis and confirmation states. If a rollback webhook returns a successful HTTP status code, Flagger +will shift all traffic back to the primary instance and fail the canary. + Manual gating with Flagger's tester: ```yaml @@ -898,4 +908,14 @@ While the promotion is paused, Flagger will continue to run the metrics checks a url: http://flagger-loadtester.test/gate/halt ``` +The `rollback` hook type can be used to manually rollback the canary promotion. + +```yaml + canaryAnalysis: + webhooks: + - name: "rollback gate" + type: rollback + url: http://flagger-loadtester.test/gate/halt +``` + If you have notifications enabled, Flagger will post a message to Slack or MS Teams if a canary promotion is waiting for approval.