Skip to content
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

Allow custom timeout value for webhook calls #3549

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

renan
Copy link
Contributor

@renan renan commented Sep 28, 2020

Because webhooks add to API request latency, they should evaluate as
quickly as possible. timeoutSeconds allows configuring how long the
API server should wait for a webhook to respond before treating the call
as a failure.

The default values from Kubernetes are, however, too large. For
admissionregistration.k8s.io/v1 the default value is 10 seconds while
for admissionregistration.k8s.io/v1beta1 is 30 seconds!

This custom/default value of 5 seconds should be more than enough for
standard installs.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 28, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @renan!

It looks like this is your first PR to kubernetes/autoscaler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/autoscaler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 28, 2020
@renan renan force-pushed the AllowCustomWebhookTimeout branch 2 times, most recently from cfc956e to a43eaa2 Compare September 28, 2020 14:58
@bskiba
Copy link
Member

bskiba commented Sep 28, 2020

Thanks, super useful. Can you set the default timeout to 30s? I know it's a ridiculously high value, but this is what the originally unconfigurable webhook timeout was set to and then the default behavior does not change unless users want to override it.

@renan renan force-pushed the AllowCustomWebhookTimeout branch from a43eaa2 to 56e4772 Compare September 28, 2020 15:05
@renan
Copy link
Contributor Author

renan commented Sep 28, 2020

@bskiba Makes sense. I amended my commit! :)

Because webhooks add to API request latency, they should evaluate as
quickly as possible. timeoutSeconds allows configuring how long the
API server should wait for a webhook to respond before treating the call
as a failure.

The default values from Kubernetes are, however, too large. For
admissionregistration.k8s.io/v1 the default value is 10 seconds while
for admissionregistration.k8s.io/v1beta1 is 30 seconds.

We keep 30 seconds as this was the original unconfigurable value.

Signed-off-by: Renan Gonçalves <[email protected]>
@renan renan force-pushed the AllowCustomWebhookTimeout branch from 56e4772 to bc5c4a5 Compare October 1, 2020 13:23
@renan
Copy link
Contributor Author

renan commented Oct 1, 2020

The previously failing test has been now fixed 👍

@bskiba
Copy link
Member

bskiba commented Oct 1, 2020

Thanks!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 1, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bskiba

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit 09c597e into kubernetes:master Oct 1, 2020
@renan renan deleted the AllowCustomWebhookTimeout branch October 1, 2020 14:43
@renan
Copy link
Contributor Author

renan commented Oct 1, 2020

@bskiba Awesome, thank you! Oh, and it would be totally awesome if you could release a v0.8.1 or something. My clusters could use this feature 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants