eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Allow for global configuration of workspace resource requests #23243

Open cgruver opened 1 week ago

cgruver commented 1 week ago

Is your enhancement related to a problem? Please describe

An inexperienced developer can cause a cluster node to become unschedulable by creating a devfile which has extreme values for cpuRequest or memoryRequest

Describe the solution you'd like

  1. Allow for global configuration of the default cpuRequest & memoryRequest values.
  2. Allow for global configuration to ignore devfile defined cpuRequest & memoryRequest entries in a devfiles.
  3. If cpuLimit or memoryLimit is set in a devfile, the cpuRequest & memoryRequest should still use the default values and not be set to the requested limits.

Describe alternatives you've considered

No response

Additional context

No response

tolusha commented 1 week ago

Hello, @cgruver

It remind me Kubernetes ResoureQuotas. Why not to use it?

ibuziuk commented 1 week ago

@cgruver in the recent release we introduced a new feature allowing configuring user namespaces with an OpenShift template which I believe should address this issue - https://github.com/eclipse-che/che/releases/tag/7.94.0

cgruver commented 1 week ago

@ibuziuk Let me take a look at that.

I would still like to consider configurable defaults.

Plus, it feels like an anti-pattern that we set limit and requests to be the same if only one of them is specified.

I may open that as a separate issue. IMO, it's a bug that I can override a default by setting a different parameter.

ibuziuk commented 1 week ago

I would still like to consider configurable defaults.

Well, it is configurable as soon as limit ranges are applied on the namespace level, right? The analogy would be the default flat pod network which is configurable on the cluster by applying specific network policies.

Plus, it feels like an anti-pattern that we set limit and requests to be the same if only one of them is specified.

Well, this is a nuanced approach - CDE is guaranteed the requested resources, preventing performance degradation for more or less stable workloads