Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cloudflare workers don't have any blue-green or canary deployments out of the box, but it would be very useful for us to deploy safely by minimizing the blast radius of bad releases.
A potential solution for this would be building our own canary rollouts using GitHub actions, axiom and a canary worker.
The idea is that the current production worker is capable of redirecting a portion of traffic via service binding to a canary worker. the rollout is enabled and configured via environment variable:
CANARY_ROLLOUT=10
would indicate 10% of the traffic is forwarded to the canary.CANARY_ROLLOUT=0
or not set, means no traffic is forwarded.The canary worker can be either accessed via canary.unkey.dev or through a service worker binding, which would run the worker in the same process, thus not introducing any latency.
A push to
main
will trigger this workflow and a manual approval by the maintainers is required to proceed in the beginning.A GitHub action will first deploy the new codebase to
canary
and then start the rollout by setting the environment variable inproduction
.The canary worker will log warnings and errors to axiom, which can then be queried by the GitHub Action and any error will stop the rollout and alert us in slack. If there are no errors or other performance regressions, we proceed.
These steps are repeated until we have rolled out to a specific percentage, see below.
Initially I'd use these numbers to configure the rollout, but we can adjust them.
Beta Was this translation helpful? Give feedback.
All reactions