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

default health check not working #965

Closed
lazybetrayer opened this issue May 25, 2020 · 11 comments
Closed

default health check not working #965

lazybetrayer opened this issue May 25, 2020 · 11 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Milestone

Comments

@lazybetrayer
Copy link

if no AddHealthzCheck is called cm.readyzHandler is nil, the health check endpoint will not be added.

if cm.healthzHandler != nil {
mux.Handle(cm.livenessEndpointName, http.StripPrefix(cm.livenessEndpointName, cm.healthzHandler))
}

But according to

if len(h.Checks) == 0 && reqPath[1:] == "ping" {
CheckHandler{Checker: Ping}.ServeHTTP(resp, req)
return
}

there should be a default check.

@lazybetrayer
Copy link
Author

Actually with the default endpoint name /healthz, only the exact match is handled, paths like /healthz/ping is never handled.

@GrigoriyMikhalkin
Copy link
Contributor

GrigoriyMikhalkin commented May 27, 2020

It's default check IN handler, not default handler. So it will work if you create handler without any custom checks. Controller, by default, doesn't create empty handlers.

Regarding second comment. I think it would be ok to add trailing slash to default endpoints and add wrapper for mux that would remove trailing slash.

@lazybetrayer
Copy link
Author

@GrigoriyMikhalkin How to create health check handler without any custom checks?

@GrigoriyMikhalkin
Copy link
Contributor

Ah, you can't do that for provided manager implementation. Beckause handler is created when you add check via Add...Check methods. But, i guess, that's not that big of a issue, to address it. If you only need ping check, you can just add it manually, like m.Add...Check("ping", healthz.Ping).

@vincepri
Copy link
Member

/milestone Next
/help

This needs some investigation, I'm not too familiar with this part of the codebase.

@k8s-ci-robot
Copy link
Contributor

@vincepri:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/milestone Next
/help

This needs some investigation, I'm not too familiar with this part of the codebase.

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.

@k8s-ci-robot k8s-ci-robot added this to the Next milestone Jul 23, 2020
@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 23, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 21, 2020
@lazybetrayer
Copy link
Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 28, 2020
@GrigoriyMikhalkin
Copy link
Contributor

@lazybetrayer Looks like solution to this problem was already merged d6fcdd6

@lazybetrayer
Copy link
Author

/close

@k8s-ci-robot
Copy link
Contributor

@lazybetrayer: Closing this issue.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
5 participants