-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Omit init containers from limitrange default request calculations #4769
Conversation
/assign vdemeester |
The following is the coverage report on the affected files.
|
This commit modifies how resource requirements are adjusted based on LimitRanges present in a namespace. Prior to this commit, the container requests for a resource were determined by dividing the default requests specified in a LimitRange by the number of app containers plus 1 (to represent the init container), taking the maximum of this value and the minimum request specified in the LimitRange, and applying this value to all containers. However, Kubernetes does not sum init container resource requests to app container resource requests when determining the pod's effective resource requests, as described here: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources. Instead, it takes the larger of the maximum init container resource requests and the sum of app container resource requests. As a result, the appropriate behavior is to split the default requests only among app containers, and to apply the default requests directly to init containers. This commit implements that behavior.
/test pull-tekton-pipeline-go-coverage |
The following is the coverage report on the affected files.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cc @abayer |
/lgtm |
/retest |
/test pull-tekton-pipeline-alpha-integration-tests |
Changes
This commit modifies how resource requirements are adjusted based on LimitRanges present
in a namespace. Prior to this commit, the container requests for a resource
were determined by dividing the default requests specified in a LimitRange by the number of
app containers plus 1 (to represent the init container), taking the maximum of this value
and the minimum request specified in the LimitRange, and applying this value to all containers.
However, Kubernetes does not sum init container resource requests to app container resource requests
when determining the pod's effective resource requests, as described here. Instead, it takes the larger of
the maximum init container resource requests and the sum of app container resource requests.
As a result, the appropriate behavior is to split the default requests only among app containers, and
to apply the default requests directly to init containers. This commit implements that behavior.
/kind bug
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes