Add apiserver, cache-sync, and db-manager checks to katib-controller /readyz - #2704
Open
bharathjyothi wants to merge 2 commits into
Open
Add apiserver, cache-sync, and db-manager checks to katib-controller /readyz #2704bharathjyothi wants to merge 2 commits into
bharathjyothi wants to merge 2 commits into
Conversation
…oller health probes Signed-off-by: Bharath Jyothi <bjyothi2002@gmail.com>
Signed-off-by: Bharath Jyothi <bjyothi2002@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
google-oss-prow
Bot
requested review from
andreyvelich,
anencore94 and
gaocegege
August 8, 2026 21:34
|
🎉 Welcome to the Kubeflow Katib repo! 🎉 Thanks for opening your first PR! We're excited to have you onboard 🚀 Next steps:
Feel free to ask questions in the comments. Thanks again for contributing! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Follows up on the
readyzTODO left in #1934:Today
/readyzonly checkshookServer.StartedChecker(), basically checking that the webhook's HTTPS listener has started. It says nothing about whether the controller can actually do its job. This PR adds three checks, each addressing a different way "ready" and "actually working" can diverge:readyz(cache-sync) :/readyznow also waits onmgr.GetCache().WaitForCacheSync. Previously a pod could report ready before its Experiment/Trial/Suggestion informers had done their initial List/Watch, so both the admission webhooks (which read cluster state through the cache-backed client) and the reconcilers could serve stale/incomplete results for a window right after startup, or indefinitely if the caches never synced (e.g. an RBAC misconfiguration).apiserver: a direct, uncachedGetthroughmgr.GetAPIReader(), proving live apiserver connectivity independent of the cache-sync check above (a cache that synced once and went stale wouldn't catch a since-severed connection).db-manager(diagnostic, non-gating): periodically polls katib-db-manager's gRPC health service (which itself only reportsSERVINGafter aSELECT 1against its DB succeeds) and logs state transitions. Deliberately not wired intoAddReadyzCheck, see below.Why db-manager doesn't gate readiness:
I initially registered it as a readyz check too, since
trial-controllerdoes depend on db-manager synchronously (pkg/controller.v1beta1/trial/managerclient) for observation logs. Verified live against a kind/minikube cluster, this reproduces a startup deadlock: katib-controller's pod-mutating webhook (failurePolicy: Fail) gates creation of every pod in thekubeflownamespace, including katib-db-manager's own pod. Kubernetes only routes Service traffic toReadypods. So: db-manager's pod can't be created until the webhook is reachable → which needs katib-controllerReady→ which needed db-manager reachable. A from-scratch deploy of controller+db-manager+mysql together hung indefinitely (dial tcp ...:443: connect: connection refusedfrom the replicaset controller) until this check was taken out of the readiness gate. Re-verified after the fix: the same fresh deploy comes up cleanly in ~16s, and the controller staysReadythrough a live db-manager outage while the diagnostic correctly logs it.Not addressed here: the second half of the original ask, tuning probe frequency/
startupProbeparameters (referenced in this discussion), is left as a separate follow-up; happy to open a new issue for it if that's preferred over leaving #1973 open.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #1973
Checklist: