Set deployment Traffic Weight via UI
Release notes
In release 13.7, you can change the canary weights directly from the deploy boards. Changing canary weights can be done directly from the .gitlab-ci.yml
and by API, but having the ability to set this in the user interface has the benefit to be able to visually see the deployment and scale up/down of the pods directly from the deploy boards.
Problem to solve
As a developer, I want to be able to easily monitor and adjust the weight annotations of canary rollouts, so I can have greater control and confidence over manual or timed incremental roll-outs and mitigate risks.
Intended users
User experience goal
The user should be able to set the traffic weight via the UI
Proposal
Acceptance criteria
- The feature is visible when canary deployments are enabled, it requires a manual set to inject
CANARY_ENABLED
variable. - Configuration of Stable VS Canary with set 5% percentage increments
- Configuring one value also adjusts the other, they are connected.
- Modal for verification of increment setting pops up after selection.
- Title:
Change the ratio of canary deployments?
- Button:
Cancel
Tertiary, default - Button:
Change ratio
Primary, info - Body:
- Title:
This will change the ratio of canary deployments vs stable deployments to:
Stable: X%
Canary: X%
Changing the ratio will start a redeployment. The ratio cannot be adjusted
again until the redeployment is complete
- When a deployment is in progress, the controls are disabled and a tooltip is shown
- Tooltip:
Deployment in progress
- Tooltip:
Controls are available
Mockup (Figma document) |
---|
Copy might have changed, check acceptance criteria |
Confirmation modal
Mockup (Figma document) |
---|
Copy might have changed, check acceptance criteria |
Controls are disabled due to a deployment change is in progress
Mockup (Figma document) |
---|
Copy might have changed, check acceptance criteria |
Follow up issues
Further details
typical scenario of the rule is based on weight, that is, blue-green deployment. You can set the weight from 0 to 100 to implement that kind of application release. At any time, only one of the environments is production. For this example, currently green is production and blue is canary. Initially, the weight of canary is set to 0which means no traffic is forwarded to this release. You can introduce a small portion of traffic to blue version step by step, test and verify it. If everything is OK then you can shift all requests from green to blue by set the weight of blue to 100which makes blue the production release. In a word, with such canary releasing process, the application is upgraded smoothly.
nginx.ingress.kubernetes.io/canary-weight:
The integer based (0 - 100) percent of random requests that should be routed to the service specified in the canary Ingress. A weight of 0 implies that no requests will be sent to the service in the Canary ingress by this canary rule. A weight of 100 means implies all requests will be sent to the alternative service specified in the Ingress.