feat: surface apiserver logs via KS_LOGGER_LEVEL=debug; document >=1.28 requirement#336
Conversation
…28 requirement The apiserver's klog output (serving, aggregation, informer-sync, post-start hooks) was unconditionally muted to Fatal, hiding the diagnostics needed to debug startup/readyz failures. A real case: on a Kubernetes 1.26 cluster the delegated-authentication informer never syncs, so /readyz reports [-]informer-sync, the pod stays NotReady, and the APIService shows MissingEndpoints -- with zero log output to explain why. Gate the klog level on KS_LOGGER_LEVEL: at debug, surface apiserver logs; otherwise keep the quiet Fatal default (no behavior change). Document the >=1.28 minimum, IPv6 bind behavior, and the debug knob in the README. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds debug-level logging capability to the storage service and documents operational requirements. The main.go changes implement conditional logger configuration based on the ChangesDebug Logging Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Summary:
|
Why
While debugging a customer's IPv6-only cluster (follow-up to #333), the storage pod was
NotReadywithMissingEndpointsand only 4 log lines — no clue why. Root cause turned out to be a Kubernetes 1.26 cluster (storage requires >= 1.28): the delegated-authentication informer never completes its cache sync against the older control plane, so/readyzis stuck at[-]informer-sync.The reason it took so long to find:
main.gounconditionally muted klog (the Kubernetes apiserver's own logger — serving, aggregation, informer-sync, post-start hooks) toFatal, dropping the reflector error that would have named the cause immediately.Changes
main.go— gate the klog level onKS_LOGGER_LEVEL. Atdebug, surface apiserver logs; otherwise keep the quietFataldefault (no behavior change unless opted in). The chart already plumbsKS_LOGGER_LEVELfromlogger.level.README.md— document the >= 1.28 requirement (with the exactinformer-sync/MissingEndpointsfailure signature), the IPv6serverBindAddressbehavior, and theKS_LOGGER_LEVEL=debugknob.Testing
go build ./...andgo vet .pass.Fatal);KS_LOGGER_LEVEL=debugnow lets apiserver diagnostics through.Related
kubescape/helm-chartsadds akubeVersion: ">=1.28.0-0"guard so 1.26 installs fail fast instead of silently wedging.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
New Features