-
Notifications
You must be signed in to change notification settings - Fork 375
Does the cgroup can make better? #2090
Comments
I don't understand neither why kata's overheads(qemu,kata-proxy,shimv2) are limited by sandbox cgroup.In my opinion ,kata's processes(qemu,kata-proxy,shimv2 )should be control by parents cgroup which is create by k8s. |
cc @jcvenegas |
@Marshalzxy you are right that kubelet will create a cgroup specifically for the pod. In Kubernetes, as is, for most scenarios, we shouldn't need to create a child cgroup, and instead should operate within the parents'. As @liangxianlong highlights, today's implementation results in the 'sandbox' being over-constrained, since the Kata created cgroup is not sized to take pod overhead into account. There were a couple of initial concerns which lead to this:
The options to fix all of this is to either just rely on upper-layer doing the right thing, or to size our cgroup to take pod-overhead into account. CRI, and OCI doesn't have a concept of PodOverhead today, and this just lives within the Pod.Spec in Kubernetes. As a result, today we cannot get this information in Kata. Based on this, I would propose we:
|
To follow up, I talked to @jcvenegas IRL, and we agree this is a bug. The current implementation should just inherit the parent's constraints. |
I agree with you that while sandboxonly=true kata should inherit parent's cgroup configuration @egernst . |
The same question
|
@liangxianlong -- Was looking to reproduce your issue exactly -- why do you define a CRD for runtimeclass? What version of kubernetes are you using? And, what version of Kata did you test with? Thx. |
When SandboxCgroupsOnly is set, we are expected to just inherit our parent's cgroup settings and to move all Kata threads within that sandbox cgroup. The initial implementation still adjusted the size of this cgroup. This commit fixes this. This commit makes a couple of functional changes, small refactors, and adds clarifying comments for some functions. Fixes: kata-containers#2090 Signed-off-by: Eric Ernst <eric.ernst@intel.com>
When SandboxCgroupsOnly is set, we are expected to just inherit our parent's cgroup settings and to move all Kata threads within that sandbox cgroup. The initial implementation still adjusted the size of this cgroup. This commit fixes this. This commit makes a couple of functional changes, small refactors, and adds clarifying comments for some functions. Fixes: kata-containers#2090 Signed-off-by: Eric Ernst <eric.ernst@intel.com>
When SandboxCgroupsOnly is set, we are expected to just inherit our parent's cgroup settings and to move all Kata threads within that sandbox cgroup. The initial implementation still adjusted the size of this cgroup. This commit fixes this. This commit makes a couple of functional changes, small refactors, and adds clarifying comments for some functions. Fixes: kata-containers#2090 Signed-off-by: Eric Ernst <eric.ernst@intel.com>
When SandboxCgroupsOnly is set, we are expected to just inherit our parent's cgroup settings and to move all Kata threads within that sandbox cgroup. The initial implementation still adjusted the size of this cgroup. This commit fixes this. This commit makes a couple of functional changes, small refactors, and adds clarifying comments for some functions. Fixes: kata-containers#2090 Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Description of problem
Hi, I try to use podoverhead in kata-containers,but i have some questions.
runtimeclass_crd.yaml
:kata_v2_class.yaml
:busybox-two.yaml
:We can see the pod is running.
[root@host-69 yaml]# kubectl get pods NAME READY STATUS RESTARTS AGE busybox-two 2/2 Running 0 4h51m
Then, I go to the pod cgroup:
Then go to the sandbox cgroup:
And the pids and process:
Accoding to these resources:
https://github.com/kata-containers/runtime/pull/1880
https://github.com/kata-containers/runtime/issues/1879
I think we should not write limits into the sandbox cgroup!
@jcvenegas
@egernst
The text was updated successfully, but these errors were encountered: