Skip to content

Commit

Permalink
Add a comment about the readyz probe
Browse files Browse the repository at this point in the history
  • Loading branch information
mimowo committed Feb 1, 2024
1 parent 35d4f0a commit 2b70e0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/kueue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ func setupProbeEndpoints(mgr ctrl.Manager) {
setupLog.Error(err, "unable to set up health check")
os.Exit(1)
}

// Wait for the webhook server to be listening before exposing the
// Kueue replica as ready. This allows users to wait with first requests
// until the Kueue deployment is available, so that the early requests are
// not rejected during startup.
// We wrap the call to GetWebhookServer in a closure to delay calling
// the function, otherwise a not fully-initialized webook server is used for
// the checks.
if err := mgr.AddReadyzCheck("readyz", func(req *http.Request) error {
return mgr.GetWebhookServer().StartedChecker()(req)
}); err != nil {
Expand Down

0 comments on commit 2b70e0c

Please sign in to comment.