flagger icon indicating copy to clipboard operation
flagger copied to clipboard

add finalizing webhook

Open cdlliuy opened this issue 2 years ago • 2 comments

Fix of issue #1193 With the changes, we can see below "canary status"

  • succeed case
flagger-helloworld-demo-rollout   Waiting     0        2022-05-16T08:01:31Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T08:02:31Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T08:03:31Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T08:04:31Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T08:05:31Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T08:06:31Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T08:07:31Z
flagger-helloworld-demo-rollout   WaitingPromotion   0        2022-05-16T08:08:31Z
flagger-helloworld-demo-rollout   Promoting          0        2022-05-16T08:15:31Z
flagger-helloworld-demo-rollout   WaitingFinalising   0        2022-05-16T08:16:31Z
flagger-helloworld-demo-rollout   Finalising          0        2022-05-16T08:27:31Z
flagger-helloworld-demo-rollout   Succeeded           0        2022-05-16T08:27:31Z
  • falied case:
NAME                              STATUS      WEIGHT   LASTTRANSITIONTIME
flagger-helloworld-demo-rollout   Succeeded   0        2022-05-16T10:07:43Z
flagger-helloworld-demo-rollout   Succeeded   0        2022-05-16T10:07:43Z
flagger-helloworld-demo-rollout   Waiting     0        2022-05-16T11:12:04Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T11:13:04Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T11:14:04Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T11:15:04Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T11:16:04Z
flagger-helloworld-demo-rollout   Progressing   0        2022-05-16T11:17:04Z
flagger-helloworld-demo-rollout   WaitingFinalising   0        2022-05-16T11:18:04Z
flagger-helloworld-demo-rollout   Failed              0        2022-05-16T11:20:04Z
flagger-helloworld-demo-rollout   Failed              0        2022-05-16T11:20:04Z

The reason to have a 'WaitingFinalising" is to have a time to handle something left-over outside k8s. i.e. we are using an external traffic management providers on azure (azure ATM). When canary starts to process, we changed the ATM policy to route some traffic to canary in waiting stage. Then before the canary scale down to zero in "Finalizing' stage, we need a time to route the traffic back to primary, so this need to apply to both succeed and failed cases.

If the idea is acceptable, I will continue to fix the unit test failures (mostly about the expected status changes)

cdlliuy avatar May 11 '22 09:05 cdlliuy

@aryan9600 @stefanprodan can you help to review again and provide your feedback to see whether this idea to add a finalizing webhook is acceptable? Thanks!

cdlliuy avatar May 19 '22 03:05 cdlliuy

If the intention is to have a webhook that runs before a canary is finalized/succeeds OR a canary is rolled back, then ConfirmFinalizing isn't the correct name for that, since it implies that the webhook confirms a canary's finalization.

aryan9600 avatar May 26 '22 14:05 aryan9600