-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Adding a "/ready" endpoint for OpenShift #2952
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
Adding a "/ready" endpoint for OpenShift #2952
Conversation
4efbcaf
to
50bfb82
Compare
func initReadinessCheckRoute(root *restful.WebService, path string, readyFunc func() bool, client *osclient.Client) { | ||
root.Route(root.GET(path).To(func(req *restful.Request, resp *restful.Response) { | ||
var healthzResponse kapi.Status | ||
err := client.Get().AbsPath("/healthz").Do().Into(healthzResponse) |
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 don't think this adds much in retrospect. Let's just do the ready check. We can always come back later and jazz it up.
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.
Sure. The Do() returns only the body of the response, not the header, so to parse it we just have two bytes - "ok" instead of also containing the header. Unclear what it contains for messages without a body.
Switch the poll on hack test-cmd and test-end-to-end to wait for the ready check to come back green |
@stevekuznetsov - once this merges, do you mind updating the example here: to actually use it? |
@derekwaynecarr Yep, on my radar. |
aac6a8b
to
4e7250e
Compare
@@ -361,6 +361,7 @@ func (c *MasterConfig) InstallProtectedAPI(container *restful.Container) []strin | |||
initControllerRoutes(root, "/controllers", c.Options.Controllers != configapi.ControllersDisabled, c.ControllerPlug) | |||
initAPIVersionRoute(root, LegacyOpenShiftAPIPrefix, legacyAPIVersions...) | |||
initAPIVersionRoute(root, OpenShiftAPIPrefix, currentAPIVersions...) | |||
initReadinessCheckRoute(root, "/ready", c.ProjectAuthorizationCache.ReadyForAccess) |
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.
minor change - can you make this "/healthz/ready"? We had a discussion about it upstream and we agreed readiness is like healthz. You may want to make the NonResourceURLs be properly wild carded (david would know how to do that) for healthz instead of explicitly enumerating the paths
4e7250e
to
b92517b
Compare
Adding "/heathz/*" ought to do it. |
b92517b
to
cb17678
Compare
does that include |
cb17678
to
f9676a8
Compare
f9676a8
to
84ccd2b
Compare
|
typo... missing an l |
84ccd2b
to
89b4f14
Compare
Yep, those two together work |
@@ -155,6 +155,7 @@ export HOME="${FAKE_HOME_DIR}" | |||
|
|||
wait_for_url "${KUBELET_SCHEME}://${KUBELET_HOST}:${KUBELET_PORT}/healthz" "kubelet: " 0.25 80 | |||
wait_for_url "${API_SCHEME}://${API_HOST}:${API_PORT}/healthz" "apiserver: " 0.25 80 | |||
wait_for_url "${API_SCHEME}://${API_HOST}:${API_PORT}/healthz/ready" "etcdcaching: " 0.25 80 |
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.
apiserver(ready)
89b4f14
to
2ea6492
Compare
[test] |
Approved LGTM [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2352/) (Image: devenv-fedora_1765) |
Evaluated for origin up to 2ea6492 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3017/) |
@derekwaynecarr
Fixes #1902