Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] initContainers not considered when calculating a pod's requests #202

Closed
awprice opened this issue May 12, 2021 · 0 comments · Fixed by #203
Closed

[BUG] initContainers not considered when calculating a pod's requests #202

awprice opened this issue May 12, 2021 · 0 comments · Fixed by #203
Labels
bug Something isn't working

Comments

@awprice
Copy link
Member

awprice commented May 12, 2021

When calculating a pod's requests, we don't seem to consider the initContainers.

There could be a case where the initContainer requests are larger than the regular container requests. In this case, the scheduler will use the initContainer's requests over the regular container requests.

See https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources

Resources
Given the ordering and execution for init containers, the following rules for resource usage apply:

  • The highest of any particular resource request or limit defined on all init containers is the effective init request/limit
  • The Pod's effective request/limit for a resource is the higher of:
    • the sum of all app containers request/limit for a resource
    • the effective init request/limit for a resource
  • Scheduling is done based on effective requests/limits, which means init containers can reserve resources for initialization that are not used during the life of the Pod.
@Jacobious52 Jacobious52 added the bug Something isn't working label May 12, 2021
awprice added a commit that referenced this issue Jun 7, 2021
This commit also:
 - Standardises uses of resource.Quantity
 - Adds expectedNodeDelta to scale up tests

fixes #202
awprice added a commit that referenced this issue Jun 24, 2021
This commit also:
 - Standardises uses of resource.Quantity
 - Adds expectedNodeDelta to scale up tests

fixes #202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants