From eab7c9f5dc72b626c1ab614f2fecaecf07d216de Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Thu, 25 Jul 2019 13:29:33 +0300 Subject: [PATCH] Add manual gating to docs --- docs/gitbook/how-it-works.md | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/gitbook/how-it-works.md b/docs/gitbook/how-it-works.md index afd2ffab8..105bf2c4e 100644 --- a/docs/gitbook/how-it-works.md +++ b/docs/gitbook/how-it-works.md @@ -884,3 +884,55 @@ As an alternative to Helm you can use the [Bash Automated Testing System](https: ``` Note that you should create a ConfigMap with your Bats tests and mount it inside the tester container. + +### Manual gating + +For manual approval of a canary deployment you can use the `confirm-rollout` webhook. +The confirmation 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. + +Manual gating with Flagger's tester: + +```yaml + canaryAnalysis: + webhooks: + - name: "gate" + type: confirm-rollout + url: http://flagger-loadtester.test/gate/halt +``` + +The `/gate/halt` returns HTTP 403 thus blocking the rollout. + +Change the URL to `/gate/approve` to start the canary analysis: + +```yaml + canaryAnalysis: + webhooks: + - name: "start gate" + type: confirm-rollout + url: http://flagger-loadtester.test/gate/approve +``` + +Manual gating can be driven with Flagger's tester API. Set the confirmation URL to `/gate/check`: + +```yaml + canaryAnalysis: + webhooks: + - name: "ask confirmation" + type: confirm-rollout + url: http://flagger-loadtester.test/gate/check +``` + +By default the gate is closed, you can start or resume the canary rollout with: + +```bash +kubectl -n test exec -it flagger-loadtester-xxxx-xxxx sh + +curl -d '{"name": "podinfo","namespace":"test"}' http://localhost:8080/gate/open +``` + +You can pause the rollout at any time with: + +```bash +curl -d '{"name": "podinfo","namespace":"test"}' http://localhost:8080/gate/close +```