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
🐛 Avoid the redirection to /healthz/
when calling /healthz
#1134
Conversation
Hi @0gajun. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
defaultReadinessEndpoint = "/readyz/" | ||
defaultLivenessEndpoint = "/healthz/" | ||
defaultReadinessEndpoint = "/readyz" | ||
defaultLivenessEndpoint = "/healthz" |
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.
These values are just default values.
Users can specify other paths here.
controller-runtime/pkg/manager/manager.go
Lines 479 to 481 in 011cd8a
if options.LivenessEndpointName == "" { | |
options.LivenessEndpointName = defaultLivenessEndpoint | |
} |
So, I think it's better to keep endpoint names consistent among readiness, liveness and metrics :)
/assign @mengqiy |
/cc @jimmidyson |
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.
Nit about no need to trim /
in tests but otherwise LGTM
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.
c9ee156
to
d6fcdd6
Compare
/ok-to-test |
/approve |
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 @0gajun
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0gajun, 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 |
By #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 like following. (Accessing/healthz/
works fine without the redirect.)By this redirect behavior, the current implementation doesn't break anything, but I think that this is unnecessary overhead in the health checking.
So, this PR enables to access
/healthz
without the redirect with keeping that subpaths of/healthz/
are accessible.By this PR,
/healthz
endpoint's response becomes like following.