Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement confirm rollout gate, hook and API #251

Merged
merged 15 commits into from
Jul 25, 2019
Merged

Implement confirm rollout gate, hook and API #251

merged 15 commits into from
Jul 25, 2019

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Jul 24, 2019

This PR adds the confirm-rollout webhook type. 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:

  canaryAnalysis:
    webhooks:
      - name: "start gate"
        type: confirm-rollout
        url: http://flagger-loadtester.test/gate/halt

The /gate/halt returns HTTP 403 thus blocking the rollout. If you have notifications enabled, Flagger will post a message to Slack or MS Teams if a canary rollout is waiting for approval.

Change the URL to /gate/approve to start the canary analysis:

  canaryAnalysis:
    webhooks:
      - name: "start gate"
        type: confirm-rollout
        url: http://flagger-loadtester.test/gate/approve

Manual gating API:

Set the confirmation URL to /gate/check:

  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:

kubectl -n test exec -it flagger-loadtester-xxxx-xxxx sh

curl -d '{"name": "podinfo","namespace":"test"}' http://localhost:8080/gate/open 

Pause rollout:

curl -d '{"name": "podinfo","namespace":"test"}' http://localhost:8080/gate/close 

Note that in order to tests this PR you have to update the Canary CRD and use the following images:

  • weaveworks/flagger:gates-f204fe5
  • weaveworks/flagger-loadtester:0.6.1

Fix: #163

means the canary rollout is paused (waiting for confirmation to proceed)
The confirm-rollout hooks are executed before the pre-rollout hooks. Flagger will halt the canary rollout until the confirm webhook returns HTTP status 200.
@stefanprodan stefanprodan mentioned this pull request Jul 24, 2019
Copy link
Contributor

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks a lot for your effort ☺️

@aackerman
Copy link
Contributor

This is awesome @stefanprodan, thanks for all the work on this!

@stefanprodan stefanprodan changed the title Implement confirm rollout gate and hook Implement confirm rollout gate, hook and API Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manual Gating
3 participants