mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Add /livez to kube-scheduler
Health endpoint `/livez` only contains ping check.
This commit is contained in:
@@ -186,7 +186,7 @@ func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *
|
||||
|
||||
// Start up the healthz server.
|
||||
if cc.SecureServing != nil {
|
||||
handler := buildHandlerChain(newHealthzAndMetricsHandler(&cc.ComponentConfig, cc.InformerFactory, isLeader, checks...), cc.Authentication.Authenticator, cc.Authorization.Authorizer)
|
||||
handler := buildHandlerChain(newHealthEndpointsAndMetricsHandler(&cc.ComponentConfig, cc.InformerFactory, isLeader, checks...), cc.Authentication.Authenticator, cc.Authorization.Authorizer)
|
||||
// TODO: handle stoppedCh and listenerStoppedCh returned by c.SecureServing.Serve
|
||||
if _, _, err := cc.SecureServing.Serve(handler, 0, ctx.Done()); err != nil {
|
||||
// fail early for secure handlers, removing the old error loop from above
|
||||
@@ -288,11 +288,12 @@ func installMetricHandler(pathRecorderMux *mux.PathRecorderMux, informers inform
|
||||
})
|
||||
}
|
||||
|
||||
// newHealthzAndMetricsHandler creates a healthz server from the config, and will also
|
||||
// newHealthEndpointsAndMetricsHandler creates an API health server from the config, and will also
|
||||
// embed the metrics handler.
|
||||
func newHealthzAndMetricsHandler(config *kubeschedulerconfig.KubeSchedulerConfiguration, informers informers.SharedInformerFactory, isLeader func() bool, checks ...healthz.HealthChecker) http.Handler {
|
||||
func newHealthEndpointsAndMetricsHandler(config *kubeschedulerconfig.KubeSchedulerConfiguration, informers informers.SharedInformerFactory, isLeader func() bool, checks ...healthz.HealthChecker) http.Handler {
|
||||
pathRecorderMux := mux.NewPathRecorderMux("kube-scheduler")
|
||||
healthz.InstallHandler(pathRecorderMux, checks...)
|
||||
healthz.InstallLivezHandler(pathRecorderMux)
|
||||
installMetricHandler(pathRecorderMux, informers, isLeader)
|
||||
slis.SLIMetricsWithReset{}.Install(pathRecorderMux)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user