Skip to content

✨ Make individual readiness and liveness checks accessible #1100

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

Merged

Conversation

jimmidyson
Copy link
Member

When a named readiness/liveness check is registered it should be available under /readyz/.
This PR enables this by adding a trailing slash to the default readyz and healthz endpoints, configuring
the server to handle existing path (/readyz) and subpaths (/readyz/my-check).

When a named readiness/liveness check is registered it should be available under /readyz/<name>.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 4, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 4, 2020
@jimmidyson
Copy link
Member Author

/assign @joelanford

Copy link
Member

@makkes makkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

nice catch! So the main idea behind this is that mux.Handler when using pattern with trailing slash also handles subtrees, right? Was not apparent to me at first sight 👍

Also we allow the readiness endpoint to be overwritten so if one provides one without trailing slash, it won't handle subtrees again, right?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 4, 2020
@jimmidyson
Copy link
Member Author

@alenkacz That's right. Also, someone could add an endpoint without trailing slash that would override the root path. It's a bit funky but I think this is right default behaviour.

Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
Thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, jimmidyson

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 Aug 4, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4ebccea into kubernetes-sigs:master Aug 4, 2020
0gajun added a commit to 0gajun/controller-runtime that referenced this pull request Aug 23, 2020
By kubernetes-sigs#1100,
subpaths of `/healthz/` can be handled.
However, this change introduced the redirection from `/healthz`
to `/healthz/` with 301 (Moved Permanently) when accessing `/healthz`
endpoint. (Accessing `/healthz/` works fine without the redirect.)

This is unnecessary overhead in the health checking.

So, this commit enable to access `/healthz` without the redirect with keeping
that subpaths of `/healthz/` are accessible.
0gajun added a commit to 0gajun/controller-runtime that referenced this pull request Aug 24, 2020
By kubernetes-sigs#1100,
subpaths of `/healthz/` can be handled.
However, this change introduced the redirection from `/healthz`
to `/healthz/` with 301 (Moved Permanently) when accessing `/healthz`
endpoint. (Accessing `/healthz/` works fine without the redirect.)

This is unnecessary overhead in the health checking.

So, this commit enable to access `/healthz` without the redirect with keeping
that subpaths of `/healthz/` are accessible.
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants