-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Default timeoutSecond and failureThreshold values when the user opts into K8s probing #5741
Conversation
Hi @dineshba. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 🙂 I think the default values for timeoutSecond and failureThreshold should be set in pkg/apis/serving/v1/revision_defaults.go
@savitaashture I am interested to work on this. Shall I add commits to this PR ? OR raise a new PR? |
@taragu Thanks for your inputs. Will look into this file |
Hi @savitaashture and @taragu Updated this PR with fix. Please have a look at it and provide your inputs. Thanks |
probe.TimeoutSeconds = 10 | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have added changes to existing SetDefaults function same as SuccessThreshold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@savitaashture Didn't notice that function. Will try to make changes as per your suggestion and amend to the PR. Thanks
pkg/apis/serving/k8s_validation.go
Outdated
@@ -471,6 +472,7 @@ func validateReadinessProbe(p *corev1.Probe) *apis.FieldError { | |||
}) | |||
} | |||
} else { | |||
v1.SetDefaults(p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add changes in pkg/apis/serving/v1/revision_defaults.go
setting default values will be taken care and you no need to handle it here again
This reverts commit f5d7800.
@dineshba
|
@savitaashture Updated the PR with missing tests |
@savitaashture @taragu Could you please review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @dgerd comented on the issue that is like this by purpose.
@@ -93,7 +93,15 @@ func (rs *RevisionSpec) SetDefaults(ctx context.Context) { | |||
if rs.PodSpec.Containers[idx].ReadinessProbe.SuccessThreshold == 0 { | |||
rs.PodSpec.Containers[idx].ReadinessProbe.SuccessThreshold = 1 | |||
} | |||
if rs.PodSpec.Containers[idx].ReadinessProbe.PeriodSeconds != 0 { | |||
if rs.PodSpec.Containers[idx].ReadinessProbe.FailureThreshold == 0 { | |||
rs.PodSpec.Containers[idx].ReadinessProbe.FailureThreshold = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are those defaults coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vagababov https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
timeoutSeconds: Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1.
failureThreshold: When a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe the Pod will be marked Unready. Defaults to 3. Minimum value is 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should they be named constant with a comment where you got them from?
I added a comment on the original issue. We deviated from K8s defaults on purpose here to enable faster probes and avoid setting default based on values of other fields within the same struct. |
/hold To solve the discussion in the issue first. |
/assign @dgerd |
Hanging for a month, any new status on this? |
@dineshba any news? |
Its on hold. We have to finalize on this comment |
It would be great to unblock this, as #5798 was closed in favor of this. |
Sorry for the delay - this PR looks good to me since we're applying the k8s defaults only when periodSeconds == 0 - which is inline with option #2 here @dineshba looks like you need to rebase |
/ok-to-test |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dineshba The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@dprotaso Thanks for the follow up. Update the branch with latest master branch. Please review it now |
The following jobs failed:
Failed non-flaky tests preventing automatic retry of pull-knative-serving-unit-tests:
and 30 more. |
@dineshba: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
if rs.PodSpec.Containers[idx].ReadinessProbe.SuccessThreshold == 0 { | ||
rs.PodSpec.Containers[idx].ReadinessProbe.SuccessThreshold = 1 | ||
} | ||
if rs.PodSpec.Containers[idx].ReadinessProbe.PeriodSeconds != 0 { | ||
if rs.PodSpec.Containers[idx].ReadinessProbe.FailureThreshold == 0 { | ||
rs.PodSpec.Containers[idx].ReadinessProbe.FailureThreshold = 3 | ||
} | ||
|
||
if rs.PodSpec.Containers[idx].ReadinessProbe.TimeoutSeconds == 0 { | ||
rs.PodSpec.Containers[idx].ReadinessProbe.TimeoutSeconds = 1 | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of code should move to the applyProbes
method now
@dineshba any news on this one? Are you still pursuing this? |
~30 days since my last inquiry. I'll close this for now. @dineshba please feel free to reopen if you're still pursuing this and want to complete this. Thanks! |
Reproduced this issue #5732 using unit tests.
Planning to set default value for
timeoutSecond and failureThreshold
in this method https://github.com/knative/serving/blob/master/pkg/apis/serving/k8s_validation.go#L443. Correct me if I am wrong.