-
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
Support activeDeadlineSeconds for Tekton pods π¦ #4217
Conversation
The following is the coverage report on the affected files.
|
Kubernetes (and OpenShift) mark `Pod` as either Terminating β has a "relatively" short life and will terminate at some point β and NonTerminating β is supposed to run for ever. Kubernetes does the difference between the two using the `ActiveDeadlineSeconds` field. A `Pod` with `activeDeadlineSeconds` set will be considered as Terminating. For example, `Job`'s `Pod` have this field set and are considered as Terminated. Currently the pods created by tekton fall under the NonTerminating quota limits of Kubernetes and OpenShift. This can create issues as generally builds should fall under the separate terminating quota limits. This sets the `activeDeadlineSeconds` field or TaskRun's `Pod` so that they are considered Terminating. It also sets the value of this field to a higher value than the specified (or default) Timeout set on the TaskRun so that Kubernetes won't try to terminate the `Pod` before Pipeline does. Signed-off-by: Vincent Demeester <[email protected]>
ffa410d
to
8c2a6ac
Compare
The following is the coverage report on the affected files.
|
Nice. This also has the effect that pods won't run forever if the controller happens to be unavailable or late to process timeouts. |
Indeed π |
/lgtm |
/test pull-tekton-integration-tests |
I imagine the active deadline seconds are counted from when the pod is scheduled? It might be nice to add a note in the docs about this, but it's ok as a follow-up pr if you prefer. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli 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 |
PR tektoncd#4217 introduced better handline of the resource quota by adding support for activeDeadlineSeconds. activeDeadlineSeconds is calculated based on this formula: int64(taskRun.GetTimeout(ctx).Seconds() * 1.5) In case when a timeout on a task is set to 0s i.e. no timeout, the taskrun fails with ambiguous message "Invalid value: 0: must be between 1 and 2147483647, inclusive." This is happening because activeDeadlineSeconds is getting set to 0 in case of a 0s timeout but in this case activeDeadlineSeconds is getting set to a value out of the permitted range. This commit is changing the way activeDeadlineSeconds is set such that its not set at all for a task with 0s timeout.
PR tektoncd#4217 introduced better handling of the resource quota by adding support for activeDeadlineSeconds. activeDeadlineSeconds is calculated based on this formula: int64(taskRun.GetTimeout(ctx).Seconds() * 1.5) In case when a timeout on a task is set to 0s i.e. no timeout, the taskrun fails with ambiguous message "Invalid value: 0: must be between 1 and 2147483647, inclusive." This is happening because activeDeadlineSeconds is set to 0 in case of a 0s timeout but in this case activeDeadlineSeconds is assigned a value out of the permitted range (1 to maxint32). This commit is changing the way activeDeadlineSeconds is set such that it is set to MaxInt32 for a task with 0s timeout.
PR #4217 introduced better handling of the resource quota by adding support for activeDeadlineSeconds. activeDeadlineSeconds is calculated based on this formula: int64(taskRun.GetTimeout(ctx).Seconds() * 1.5) In case when a timeout on a task is set to 0s i.e. no timeout, the taskrun fails with ambiguous message "Invalid value: 0: must be between 1 and 2147483647, inclusive." This is happening because activeDeadlineSeconds is set to 0 in case of a 0s timeout but in this case activeDeadlineSeconds is assigned a value out of the permitted range (1 to maxint32). This commit is changing the way activeDeadlineSeconds is set such that it is set to MaxInt32 for a task with 0s timeout.
PR tektoncd#4217 introduced better handling of the resource quota by adding support for activeDeadlineSeconds. activeDeadlineSeconds is calculated based on this formula: int64(taskRun.GetTimeout(ctx).Seconds() * 1.5) In case when a timeout on a task is set to 0s i.e. no timeout, the taskrun fails with ambiguous message "Invalid value: 0: must be between 1 and 2147483647, inclusive." This is happening because activeDeadlineSeconds is set to 0 in case of a 0s timeout but in this case activeDeadlineSeconds is assigned a value out of the permitted range (1 to maxint32). This commit is changing the way activeDeadlineSeconds is set such that it is set to MaxInt32 for a task with 0s timeout.
Changes
Kubernetes (and OpenShift) mark
Pod
as either Terminating β has a"relatively" short life and will terminate at some point β and
NonTerminating β is supposed to run for ever. Kubernetes does the
difference between the two using the
ActiveDeadlineSeconds
field. APod
withactiveDeadlineSeconds
set will be considered asTerminating. For example,
Job
'sPod
have this field set and areconsidered as Terminated.
Currently the pods created by tekton fall under the NonTerminating
quota limits of Kubernetes and OpenShift. This can create issues as
generally builds should fall under the separate terminating quota
limits.
This sets the
activeDeadlineSeconds
field or TaskRun'sPod
so thatthey are considered Terminating. It also sets the value of this field
to a higher value than the specified (or default) Timeout set on the
TaskRun so that Kubernetes won't try to terminate the
Pod
beforePipeline does.
Signed-off-by: Vincent Demeester [email protected]
/kind feature
/cc @sbwsg @bobcatfish @mattmoor @pritidesai @jerop
Tentatively adding the 0.28 milestone π
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes