Skip to content

Add canary analysis schedule interval to CRD#20

Merged
stefanprodan merged 10 commits intomasterfrom
scheduler
Jan 11, 2019
Merged

Add canary analysis schedule interval to CRD#20
stefanprodan merged 10 commits intomasterfrom
scheduler

Conversation

@stefanprodan
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan commented Jan 6, 2019

Make the analysis schedule configurable fix: #19

  canaryAnalysis:
    # schedule interval (default 60s)
    interval: 1m
    # max number of failed metric checks before rollback
    threshold: 10
    # max traffic percentage routed to canary
    # percentage (0-100)
    maxWeight: 50
    # canary increment step
    # percentage (0-100)
    stepWeight: 2

The above analysis, if it succeeds, will run for 25 minutes while validating the HTTP metrics and webhooks every minute.

You can determine the minimum time that it takes to validate and promote a canary deployment using this formula:

interval * (maxWeight / stepWeight)

And the time it takes for a canary to be rollback when the metrics or webhooks checks are failing:

interval * (threshold + 1) 

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 6, 2019

Codecov Report

Merging #20 into master will decrease coverage by 1.41%.
The diff coverage is 13.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
- Coverage   50.95%   49.53%   -1.42%     
==========================================
  Files           7        8       +1     
  Lines         942      969      +27     
==========================================
  Hits          480      480              
- Misses        381      408      +27     
  Partials       81       81
Impacted Files Coverage Δ
pkg/controller/router.go 85.78% <ø> (ø) ⬆️
pkg/controller/webhook.go 62.5% <ø> (ø) ⬆️
pkg/controller/recorder.go 85.71% <ø> (ø) ⬆️
pkg/controller/job.go 0% <0%> (ø)
pkg/controller/controller.go 6.91% <0%> (-0.05%) ⬇️
pkg/controller/deployer.go 58.09% <100%> (ø) ⬆️
pkg/controller/scheduler.go 23.65% <4.76%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06c2905...07f66e8. Read the comment docs.

- new field canaryAnalysis.interval
@stefanprodan stefanprodan changed the title Add canary analysis schedule interval Add canary analysis schedule interval to CRD Jan 6, 2019
if r.Spec.TargetRef.Kind == "Deployment" {
go c.advanceCanary(r.Name, r.Namespace)
canary := value.(*flaggerv1.Canary)
name := key.(string)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: It'd be good to have a comment to show what these keys look like, it's hard to tell from the code. I'd assume it's something like <namespace>/<name>, but I'm not sure exactly.

Copy link
Copy Markdown
Member Author

@stefanprodan stefanprodan Jan 8, 2019

Choose a reason for hiding this comment

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

Yes it's <name>.<namespace> I'll add a comment thanks!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@stefanprodan stefanprodan merged commit 3bff2c3 into master Jan 11, 2019
@stefanprodan stefanprodan deleted the scheduler branch January 11, 2019 18:06
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.

Make the canary analysis interval configurable in the CRD

3 participants