Set default and maximum memory and CPU for workspaces
MR: Pending
Description
As a gitlab instance administrator, I want to place a limit on the CPU and memory that can be requested by a workspace to limit the overall infrastructure costs incurred.
The initial Beta for workspaces allows you to configure the CPU and memory limits in the devfile, but there are no limits to what you can request. This could lead to maxing out clusters and driving up costs when adopted at scale.
To preserve server resources, we should introduce a configuration on the agent that establishes the default and maximum CPU and memory resources a workspace can request.
This is to be set at an agent level and not at a group or instance level because different agents may be deployed with different use cases (and cost centers) in mind.
Acceptance Criteria
-
Workspaces cannot request more than the maximum CPU or memory defined in the agent configuration. -
The sum of the CPI/memory of all containers is compared with the maximum CPU/memory. -
A workspace created from a devfile that does not define the CPU or memory requests will inherit the default define in the agent config -
An attempt to create a workspace from a devfile that exceeds the maximum CPU or memory defined in the agent will return an error and no workspace will be created.
Technical Requirements
TODO: Fill out or delete [If applicable, please list out any technical requirements for this feature/enhancement.]
Design Requirements
We'll need to surface an appropriate error message on the New Workspace view, but otherwise there should be no additional UI needed.
Impact Assessment
With this feature, admins will have more control over the compute costs associated with using workspaces at scale.
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.