Skip to content

Commit

Permalink
Add manual gating to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Jul 25, 2019
1 parent 046245a commit eab7c9f
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/gitbook/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit eab7c9f

Please sign in to comment.