question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to set CPU limits as well on the plugin containers?

See original GitHub issue

The che-plugin.yml containing the plugin container and related specs does not seem to have a field for CPU limits while the same exists for Memory as memorylimit.

Is there a possible workaround or plan to support the same?

This can be especially useful since plugins should not be able to maliciously deprive the other containers of the pod from being able to use cpu resources.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
l0rdcommented, Nov 14, 2019

@amisevsk that’s not about making it mandatory to set the CPU limits but about having the possibility to do it.

You are right when you say that currently everything works fine on OSO. In the last 2 years we have designed the OpenShift infra so that it worked fine on OSO. But that’s a peculiar OpenShift cluster and the admission controller you are mentioning (along with the storage backend etc…) is something that users won’t find on different OpenShift/Kubernetes clusters.

Here is a common configuration of an OpenShift clusters:

  • There is a default CPU limit per containers (for example 500mi)
  • If the CPU limit for a container is not specified the default one is applied
  • Namespaces have a CPU Quota per namespace (for example 2 cores)

In such a cluster, when a user starts a Che workspace with more than 4 containers (something pretty common: theia, machine-exec, 2 plugins and one runtime container) it fails miserably because the workspace pod exceeds the CPU quota! And there is nothing a user can do to fix that. There is no way to specify the CPU limit in the devfile and there is no way to specify it in the plugins meta.yaml neither. That’s frustrating and pretty common on real world clusters.

That’s an issue that has already been raised by customers, developers advocates, Red Hat SA and PMs preparing demos. You can easily reproduce it on RHDPS. This is currently a P1 but may become a blocker.

cc @slemeur @RickJWagner

1reaction
sleshchenkocommented, May 24, 2019

Currently, it’s not allowed and AFAIK there are no plans to implement it soon. @ibuziuk @amisevsk Maybe you have another input.

But it should not be very difficult, If you’re interested to make a contribution to Che and you need some assistance I can help you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assign CPU Resources to Containers and Pods - Kubernetes
This page shows how to assign a CPU request and a CPU limit to a container. Containers cannot use more CPU than the...
Read more >
Kubernetes : Assign CPU Resource Defaults and Limits to ...
In this tutorial, we will explore how to declare and limit CPU resources according to the requirements of your Kubernetes Pods.
Read more >
Runtime options with Memory, CPUs, and GPUs
Docker provides ways to control how much memory, or CPU a container can use, setting runtime configuration flags of the docker run command....
Read more >
Understanding resource limits in kubernetes: cpu time - Medium
The good news is that cpu limits are controlled by the same cgroups ... pod containers, you might think it would be nice...
Read more >
Setting the right requests and limits in Kubernetes - Learnk8s
Unlike CPU requests, the limits of one container do not affect the CPU usage of other containers. That's precisely what happens in Kubernetes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found