metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

Support resource limits in Kubernetes.

Open roofurmston opened this issue 2 years ago • 2 comments

Kubernetes provides support for both resource requests & limits. At present, Metaflow supports requests only. It would be good if Metaflow could also provide support for limits, as these can be beneficial in certain situations.

After discussion on Slack, the general idea would be to have a flag (in the Metaflow config) that can be used to switch between the use of either requests or limits. Slack thread can be found here.

roofurmston avatar Sep 18 '23 15:09 roofurmston

While this might solve a few people's problems, I think the suggested solution is still not sufficient.

Requests are “I need at least X”, limits are “I want this pod to use at most Y”. These should not really be exclusive. When using Kubernetes, often you want to specify both of these. So I am a little worried that the suggested solution, will move us to a worse position for making a good solution in the future, because then we end up having this flag which then needs to be deprecated.

elgehelge avatar Oct 02 '23 07:10 elgehelge

In my experience people tend to use either requests or limits and not both, so I'd personally expect this approach to be sufficient for most use cases.

To clarify (one of) my use cases a bit more, we would like to enact LimitRanges on our namespaces to enforce default and maximum limits on resources. To do this we need a mechanisim to allow users to specify limits themselves. Otherwise we would end up with cases in which people specify requests that exceed the default limits and this would be an invalid specification.

In terms of the proposed solution, I guess it was proposed as adding functionality to specify both requests & limits would have required far more extensive changes to the code base?

tfurmston avatar Oct 08 '23 09:10 tfurmston