type healthMux … type healthCheckRegistry … func (reg *healthCheckRegistry) addHealthChecks(checks ...healthz.HealthChecker) error { … } func (reg *healthCheckRegistry) addDelayedHealthChecks(delay time.Duration, checks ...healthz.HealthChecker) error { … } func (reg *healthCheckRegistry) installHandler(mux healthMux) { … } func (reg *healthCheckRegistry) installHandlerWithHealthyFunc(mux healthMux, firstTimeHealthy func()) { … } // AddHealthChecks adds HealthCheck(s) to health endpoints (healthz, livez, readyz) but // configures the liveness grace period to be zero, which means we expect this health check // to immediately indicate that the apiserver is unhealthy. func (s *GenericAPIServer) AddHealthChecks(checks ...healthz.HealthChecker) error { … } // AddBootSequenceHealthChecks adds health checks to the old healthz endpoint (for backwards compatibility reasons) // as well as livez and readyz. The livez grace period is defined by the value of the // command-line flag --livez-grace-period; before the grace period elapses, the livez health checks // will default to healthy. One may want to set a grace period in order to prevent the kubelet from restarting // the kube-apiserver due to long-ish boot sequences. Readyz health checks, on the other hand, have no grace period, // since readyz should fail until boot fully completes. func (s *GenericAPIServer) AddBootSequenceHealthChecks(checks ...healthz.HealthChecker) error { … } // addHealthChecks adds health checks to healthz, livez, and readyz. The delay passed in will set // a corresponding grace period on livez. func (s *GenericAPIServer) addHealthChecks(livezGracePeriod time.Duration, checks ...healthz.HealthChecker) error { … } // AddReadyzChecks allows you to add a HealthCheck to readyz. func (s *GenericAPIServer) AddReadyzChecks(checks ...healthz.HealthChecker) error { … } // AddLivezChecks allows you to add a HealthCheck to livez. func (s *GenericAPIServer) AddLivezChecks(delay time.Duration, checks ...healthz.HealthChecker) error { … } // addReadyzShutdownCheck is a convenience function for adding a readyz shutdown check, so // that we can register that the api-server is no longer ready while we attempt to gracefully // shutdown. func (s *GenericAPIServer) addReadyzShutdownCheck(stopCh <-chan struct{ … } // installHealthz creates the healthz endpoint for this server func (s *GenericAPIServer) installHealthz() { … } // installReadyz creates the readyz endpoint for this server. func (s *GenericAPIServer) installReadyz() { … } // installLivez creates the livez endpoint for this server. func (s *GenericAPIServer) installLivez() { … } // delayedHealthCheck wraps a health check which will not fail until the explicitly defined delay has elapsed. This // is intended for use primarily for livez health checks. func delayedHealthCheck(check healthz.HealthChecker, clock clock.Clock, delay time.Duration) healthz.HealthChecker { … } type delayedLivezCheck … func (c delayedLivezCheck) Name() string { … } func (c delayedLivezCheck) Check(req *http.Request) error { … }