Skip to content

Commit 1847ee2

Browse files
committed
Add documenation about setting resource limits on a Task step
Signed-off-by: Konrad Scherer <kmscherer@gmail.com>
1 parent 3ea5981 commit 1847ee2

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

docs/taskruns.md

+5
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ spec:
198198

199199
**Note:** You can use the `paths` field to [override the paths to a `Resource`](resources.md#overriding-where-resources-are-copied-from).
200200

201+
### Specifying `Resource` limits
202+
203+
Each Step in a Task can specify its resource requirements. See
204+
[Defining `Steps`](tasks.md#defining-steps)
205+
201206
### Specifying a `Pod` template
202207

203208
You can specify a [`Pod` template](podtemplates.md) configuration that will serve as the configuration starting

docs/tasks.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,30 @@ The following requirements apply to each container image referenced in a `steps`
156156

157157
- The container image must abide by the [container contract](./container-contract.md).
158158
- Each container image runs to completion or until the first failure occurs.
159-
- The CPU, memory, and ephemeral storage resource requests will be set to zero, or, if
160-
specified, the minimums set through `LimitRanges` in that `Namespace`,
161-
if the container image does not have the largest resource request out of all
162-
container images in the `Task.` This ensures that the Pod that executes the `Task`
163-
only requests enough resources to run a single container image in the `Task` rather
164-
than hoard resources for all container images in the `Task` at once.
159+
- The CPU, memory, and ephemeral storage resource requests will be set
160+
to zero (also known as
161+
[BestEffort](https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-besteffort)),
162+
or, if specified, the minimums set through `LimitRanges` in that
163+
`Namespace`, if the container image does not have the largest
164+
resource request out of all container images in the `Task.` This
165+
ensures that the Pod that executes the `Task` only requests enough
166+
resources to run a single container image in the `Task` rather than
167+
hoard resources for all container images in the `Task` at once.
168+
169+
Below is an example of setting the resource requests and limits for a step:
170+
171+
```yaml
172+
spec:
173+
steps:
174+
- name: step-with-limts
175+
resources:
176+
requests:
177+
memory: 1Gi
178+
cpu: 500m
179+
limits:
180+
memory: 2Gi
181+
cpu: 800m
182+
```
165183

166184
#### Reserved directories
167185

0 commit comments

Comments
 (0)