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

When maxWeight is not exact multiple of stepWeight, canary promotion reports success, but leaves deployed app at old version #189

Closed
olga-mir opened this issue May 22, 2019 · 1 comment
Labels
kind/bug Something isn't working

Comments

@olga-mir
Copy link
Contributor

istio 1.1.6, k8s - 1.11.9, flagger - 0.13.2

After successful canary analysis Flagger reports successful canary promotion, but it doesn't copy the canary spec to the primary. That means that Flagger reports success, but the deployed app, after the promotion, is at the old version.

Steps to reproduce:

  • Define maxWeight and stepWeight in such a way that the former is not a multiple of the latter.

I believe this is the block of code which is causing the problem: https://github.com/weaveworks/flagger/blob/12d84b2e241438e4088f65eeecbcb850fba3f222/pkg/controller/scheduler.go#L362-L370

This might be a misuse or something I've missed in documentation, but in end of the day the behaviour seems dangerous - report success and fail to do the job. I assume it should be safe to change the == condition to >=. If it is not then maybe a ValidatingWebhook can be implemented for this case?

Flagger logs in failure scenario (maxWeight = 61, stepWeight = 15):

{"level":"info","ts":"2019-05-21T05:26:51.098Z","caller":"controller/controller.go:254","msg":"Initialization done! podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:14:51.061Z","caller":"controller/controller.go:254","msg":"New revision detected! Scaling up podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:16:51.103Z","caller":"controller/controller.go:254","msg":"Starting canary analysis for podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:16:51.126Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 15","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:18:51.132Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 30","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:20:51.123Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 45","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:22:51.189Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 60","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T06:24:51.103Z","caller":"controller/controller.go:254","msg":"Promotion completed! Scaling down podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-21T07:25:06.260Z","caller":"controller/controller.go:134","msg":"Deleting podinfo.playground from cache"}
{"level":"info","ts":"2019-05-21T07:25:43.410Z","caller":"controller/controller.go:228","msg":"Synced playground/podinfo"}

Flagger logs in success scenario (maxWeight = 45, stepWeight = 15):

{"level":"info","ts":"2019-05-22T00:58:21.737Z","caller":"controller/controller.go:254","msg":"Initialization done! podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:00:21.732Z","caller":"controller/controller.go:254","msg":"New revision detected! Scaling up podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:02:21.727Z","caller":"controller/controller.go:254","msg":"Starting canary analysis for podinfo.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:02:21.746Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 15","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:04:21.767Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 30","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:06:21.758Z","caller":"controller/controller.go:254","msg":"Advance podinfo.playground canary weight 45","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:06:21.758Z","caller":"controller/controller.go:254","msg":"Copying podinfo.playground template spec to podinfo-primary.playground","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:06:21.895Z","caller":"canary/tracker.go:312","msg":"Secret gate-credentials-primary synced","canary":"podinfo.playground"}
{"level":"info","ts":"2019-05-22T01:08:21.761Z","caller":"controller/controller.go:254","msg":"Promotion completed! Scaling down podinfo.playground","canary":"podinfo.playground"}
@stefanprodan
Copy link
Member

Fixed by #190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants