Skip to content

Commit 8c87bf9

Browse files
lbernicktekton-robot
authored andcommitted
Update docs to reflect resource requests of pods
Tekton previously modified step resource requests to request one large container (with the max resource request of any Step) and resource requests of 0 in all other containers. This behavior was modified in v0.28.0. Now, the Step resource requests are preserved (unless any LimitRanges are present). This commit updates the documentation to reflect this change. This commit also updates the description of how init container and container resource requests are combined to determine the resulting pod's resource requests, based on [Kubernetes documentation](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources).
1 parent 1ddb31c commit 8c87bf9

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

docs/limitrange.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,21 @@ Resource types for both are:
3535
The next question is : how pods with resource and limits are run/scheduled ?
3636
The scheduler *computes* the amount of CPU and memory requests (using **Requests**) and tries to find a node to schedule it.
3737

38-
Requests and limits can be applied to both Containers and Init Containers.
39-
- For init containers, the max of each type is taken
40-
- For containers, it sums all requests/limits for each containers
38+
A pod's [effective resource requests and limits](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources) are the higher of:
39+
- the sum of all app containers request/limit for a resource
40+
- the effective init request/limit for a resource
4141

42-
This means, if you got the following:
43-
- initContainer1 : 1 CPU, 100m memory
44-
- initContainer2 : 2 CPU, 200m memory
45-
- container1 : 1 CPU, 50m memory
46-
- container2 : 2 CPU, 250m memory
47-
- container3 : 3 CPU, 500m memory
42+
For example, if you have the following requests:
43+
- initContainer1 : 1 CPU, 100Mi memory
44+
- initContainer2 : 2 CPU, 200Mi memory
45+
- container1 : 1 CPU, 50Mi memory
46+
- container2 : 2 CPU, 250Mi memory
47+
- container3 : 3 CPU, 500Mi memory
4848

4949
The computation will be:
50-
- CPU : 2 (max init containers) + 6 (sum of containers) = 8 CPU
51-
- Memory: 200m (max init containers) + 800m (sum of containers) = 1000m (1G)
50+
- CPU : the max init container CPU is 2, and the sum of the container CPUs is 6. The resulting pod will use 6 CPUs, the max of the init container and container CPU values.
51+
- Memory: the max init container memory is 200Mi, and the sum of the container memory requests is 800Mi.
52+
The resulting pod will use 800Mi, the max of the init container and container memory values.
5253

5354
## Tekton support
5455

docs/tasks.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,9 @@ The following requirements apply to each container image referenced in a `steps`
163163

164164
- The container image must abide by the [container contract](./container-contract.md).
165165
- Each container image runs to completion or until the first failure occurs.
166-
- The CPU, memory, and ephemeral storage resource requests will be set
167-
to zero (also known as
168-
[BestEffort](https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-besteffort)),
169-
or, if specified, the minimums set through `LimitRanges` in that
170-
`Namespace`, if the container image does not have the largest
171-
resource request out of all container images in the `Task.` This
172-
ensures that the Pod that executes the `Task` only requests enough
173-
resources to run a single container image in the `Task` rather than
174-
hoard resources for all container images in the `Task` at once.
166+
- The CPU, memory, and ephemeral storage resource requests set on `Step`s
167+
will be adjusted to comply with any [`LimitRange`](https://kubernetes.io/docs/concepts/policy/limit-range/)s
168+
present in the `Namespace`. For more detail, see [LimitRange support in Pipeline](./limitrange.md).
175169

176170
Below is an example of setting the resource requests and limits for a step:
177171

0 commit comments

Comments
 (0)