Scale deployments directly from the deploy board
Owners
UX: ? FE: ? BE: @matteeyah
Description
Auto DevOps can leverage variables to define how many pods should be created during a deployment (PRODUCTION_REPLICAS
, CANARY_PRODUCTION_REPLICAS
, etc.): https://docs.gitlab.com/ee/topics/autodevops/#advanced-replica-variables-setup.
We should espose this variables in the CI/CD > Environments page, and allow users to easily change this values in the UI. After the change, we can automate the redeployment to apply the new number of requested pods.
### Original proposal
This should support also environment-specific variables (related to https://gitlab.com/gitlab-org/gitlab-ce/issues/41436) in a transparent way for the user.
In the UI, we should make users aware that this flow works if they are using Auto DevOps, or if they implement a similar logic in their deployment jobs. It will link to documentation on how to leverage environment variables to deploy applications with a specific number of pods.
Proposal
A new Scale deployment
link is added next to the Instances
title for each environment:
When the link is clicked, the deploy board section is expanded inline to show the scaling options. The Scale deployment
link is no longer available since we have entered scaling mode.
A message is shown at the top of the new section to inform users that this feature only works with certain configurations:
Please, make sure your deployment job is compatible with scaling. Read our documentation for more details.
TODO: Determine the documentation link
Below, the new option is shown. The description text informs the user that this change will affect deployments that happen after they save:
Increase or decrease the number of instances used for this environment. This will affect future deployments.
The actual value is edited through a text field with arrow controls for easy modification.
Finally, there is a Save
and Cancel
button.
If the user collapses the environment, this section should be collapsed along with the rest of the deploy board.
We will check whether the configuration is compatible with deployment scaling:
Create
environment_scaling
that is gonna have all scaling options,We gonna update
enviroment_scaling
once show the page,We forbid updating
environment_scaling
if you havePRODUCTION_REPLICAS
(for ex.) set as Secret Variable, as this is conflicting,We show the error message, linking to edit of Secret Variables, the user deletes them, save, gets back to this page, clicks save and it's done,
We make
environment_scaling
to be included in variables sent to the runner.
If we detect that the configuration is incompatible, the default message is hidden and we show this message in a warning box:
Some of the secret variables in this project are incompatible with deployment scaling. Read our documentation for more details.
Secret variables will link to project/settings/ci_cd
TODO: Determine which docs page to link to for the second anchor
The field and Save
button will be disabled.
The content of the field will be taken from the 'conflicting' variable.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.