-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check for limitrange minimum for taskrun container requests
- Loading branch information
1 parent
ad6610e
commit 482085d
Showing
6 changed files
with
239 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Tekton LimitRange Config | ||
|
||
This documentation holds information on how to create a `tekton-limitrange-config` in | ||
the event you would like to apply a LimitRange minimum for container requests instead | ||
of Tekton's default behavior. | ||
|
||
## How Tekton Handles Container Requests for a TaskRun | ||
|
||
In order to request the minimum amount of resources needed to support the containers | ||
for Steps that are part of a TaskRun, Tekton only requests the maximum values for CPU, | ||
memory, and ephemeral storage from the Steps that are part of a TaskRun. Only the max | ||
resource request values are needed since Steps only execute one at a time in TaskRun pod. | ||
All requests that are not the max values are set to zero as a result. | ||
|
||
## tekton-limitrange-config Example | ||
|
||
The [behavior above](#How-Tekton-Handles-Container-Requests) is how Tekton carries out | ||
TaskRuns by default, but, in the event you are working in a namespace that has a LimitRange | ||
minimum defined for container requests, a ConfigMap named `tekton-limitrange-config` can be | ||
created that holds the name of the LimitRange in the namespace where your TaskRuns are to be ran. | ||
|
||
An example `tekton-limitrange-config` is shown below: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: tekton-limitrange-config | ||
data: | ||
default-limitrange-name: "limit-mem-cpu-per-container" | ||
``` | ||
In the example above, the `tekton-limitrange-config` would apply the container request minimum from | ||
a LimitRange named `limit-mem-cpu-per-container`. Instead of requesting a zero quantity for all non | ||
maximum container request values for a TaskRun, the container request minimum from `limit-mem-cpu-per-container` | ||
would be used instead. | ||
|
||
## Creating the tekton-limitrange-config | ||
|
||
To use the `tekton-limitrange-config`, a ConfigMap must be created that is named `tekton-limitrange-config` and | ||
has a key named `default-limitrange-name` with a value that corresponds to the LimitRange name. The ConfigMap | ||
must be created in the namespace where your TaskRuns will be ran. | ||
|
||
After defining the ConfigMap for the `tekton-limitrange-config` in a file, use `kubectl apply -f` to make the | ||
LimitRange name available to Tekton. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters