[ 
https://issues.apache.org/jira/browse/YUNIKORN-706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17379581#comment-17379581
 ] 

Weiwei Yang edited comment on YUNIKORN-706 at 7/13/21, 4:52 AM:
----------------------------------------------------------------

hi [~Yukali]

Thank for the link, it helps. Before digging into the code changes in detail. I 
have a question with one more thing:

As the document said if the effective init resource request is \{memory: 1024m, 
cpu: 2}, and the sum of pod container resources is \{memory: 1024m, cpu: 1}. 
The pod effective resource will be \{memory: 1024m, cpu: 2}.

As a result, the pod resource in YK will be \{memory: 1024m, cpu: 2}. We use 
the pod resource to compute resource quota in the queue, and the allocation for 
an app and node. That means in all these places, we will consider the pod uses 
\{memory: 1024m, cpu: 2}. 

However, the init-container terminates before the pod containers are started. 
When the pod transits to the "Running" state, what will be the resources look 
like in K8s namespace resource quota and node? Will that still be the \{memory: 
1024m, cpu: 2}, or \{memory: 1024m, cpu: 1}?

FYI: if you do not have an immediate answer, you can run some simple 
experiments to verify. You can set [namespace resource 
quota|https://kubernetes.io/docs/concepts/policy/resource-quotas/] and run a 
pod like above to see how the resource quota is calculated. You can describe 
the namespace resource quota and see how resources are used. Similarly, you can 
describe the node and see how the node calculates the resources.


was (Author: wwei):
hi [~Yukali]

Thank for the link, it helps. Before digging into the code changes in detail. I 
have a question with one more thing:

As the document said if the effective init resource request is \{memory: 1024m, 
cpu: 2}, and the sum of pod container resources is \{memory: 1024m, cpu: 1}. 
The pod effective resource will be \{memory: 1024m, cpu: 2}.

As a result, the pod resource in YK will be \{memory: 1024m, cpu: 2}. We use 
the pod resource to compute resource quota in the queue, and the allocation for 
an app and node. That means in all these places, we will consider the pod uses 
\{memory: 1024m, cpu: 2}. 

However, the init-container terminates before the pod containers are started. 
When the pod transits to the "Running" state, what will be the resources look 
like in K8s namespace resource quota and node? Will that still be the \{memory: 
1024m, cpu: 2}, or \{memory: 1024m, cpu: 1}?

> Fix the resource calculation when the pod has init-containers
> -------------------------------------------------------------
>
>                 Key: YUNIKORN-706
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-706
>             Project: Apache YuniKorn
>          Issue Type: Bug
>          Components: shim - kubernetes
>            Reporter: Weiwei Yang
>            Assignee: Chen Yu Teng
>            Priority: Critical
>              Labels: newbie
>             Fix For: 1.0.0
>
>
> Init-container resources currently got skipped:
> Steps to reproduce:
>  # Submit pod with init containers.
>  # Check UI for app allocations. It only displays the container request of 
> 50m/50M, and not the initContainer request of 100m/100M.
> {code:java}
> 9650-mbp15-rozhang:~ rozhang$ kubectl get pods -n dev
> NAME    READY   STATUS     RESTARTS   AGE
> app-4   0/1     Init:0/1   0          5s
> {code}
> From describe node, we see requests of 100m/100M, which is not the same as 
> Yunikorn.
> Related doc: 
> https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to