From 2b70e0c19412f93f0c736ed58c793d82464d8bea Mon Sep 17 00:00:00 2001 From: Michal Wozniak Date: Thu, 1 Feb 2024 09:39:58 +0100 Subject: [PATCH] Add a comment about the readyz probe --- cmd/kueue/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/kueue/main.go b/cmd/kueue/main.go index 662af737b0..ea93bfb04c 100644 --- a/cmd/kueue/main.go +++ b/cmd/kueue/main.go @@ -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 {