Change:
<!-- Please only use this template for submitting enhancement requests --What would you like to be : When using GenericAPIServer you can only add new checks via function which adds them to all , , and endpoints. All other methods like are private. I would like to request those methods to be made public: Why is this needed: Developers of apiservers should be able to define their readiness probes add them to specific endpoint of their choosing. For example in case of Metrics Server we defined probes: Readiness - Metrics cache is full. As MS serves data only from cache, traffic will be only sent after cache is full. Liveness - Metric scraping loop is not deadlocked. It doesn't make sense to have those probes to both endpoints. Not ready metric cache should not cause MS being killed via liveness probe. Delayed scrape should not cause traffic not being served from cache due failing readiness probe. /assign
/sig apimachinery
The label(s) cannot be applied, because the repository doesn't have them <detailsIn response to : /sig apimachinery Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig api-machinery
/cc /triage accepted
I can see this. PR welcome.

Discussion:
} } // TODO: Once we get rid of /healthz consider changing this to post-start-hook. <del> err := s.addReadyzChecks(healthz.NewInformerSyncHealthz(c.SharedInformerFactory)) </del> <ins> err := s.AddReadyzChecks(healthz.NewInformerSyncHealthz(c.SharedInformerFactory)) </ins> if err != nil { return nil, err }

return fmt.Errorf("unable to add because the healthz endpoint has already been created") } s.healthzChecks = append(s.healthzChecks, checks...) <del> return s.addLivezChecks(livezGracePeriod, checks...) </del> <ins> if err := s.AddLivezChecks(livezGracePeriod, checks...); err != nil { return err } return s.AddReadyzChecks(checks...) </ins> } <del> // addReadyzChecks allows you to add a HealthCheck to readyz. func (s *GenericAPIServer) addReadyzChecks(checks ...healthz.HealthChecker) error { </del> <ins> // AddReadyzChecks allows you to add a HealthCheck to readyz. func (s *GenericAPIServer) AddReadyzChecks(checks ...healthz.HealthChecker) error { </ins> s.readyzLock.Lock() defer s.readyzLock.Unlock() if s.readyzChecksInstalled {

return nil } <del> // addLivezChecks allows you to add a HealthCheck to livez. It will also automatically add a check to readyz, // since we want to avoid being ready when we are not live. func (s *GenericAPIServer) addLivezChecks(delay time.Duration, checks ...healthz.HealthChecker) error { </del> <ins> // AddLivezChecks allows you to add a HealthCheck to livez. func (s *GenericAPIServer) AddLivezChecks(delay time.Duration, checks ...healthz.HealthChecker) error { </ins> s.livezLock.Lock() defer s.livezLock.Unlock() if s.livezChecksInstalled {

for _, check := range checks { s.livezChecks = append(s.livezChecks, delayedHealthCheck(check, s.livezClock, delay)) } <del> return s.addReadyzChecks(checks...) </del> <ins> return nil </ins> } // 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{}) error { <del> return s.addReadyzChecks(shutdownCheck{stopCh}) </del> <ins> return s.AddReadyzChecks(shutdownCheck{stopCh}) </ins> } // installHealthz creates the healthz endpoint for this server