mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-01 06:10:17 +00:00 
			
		
		
		
	add healthz to genericapiserver
This commit is contained in:
		| @@ -235,6 +235,12 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv | ||||
| 		masterReceiver.SetMaster(m) | ||||
| 	} | ||||
|  | ||||
| 	// TODO have this start method actually use the normal start sequence for the API server | ||||
| 	// this method never actually calls the `Run` method for the API server | ||||
| 	// fire the post hooks ourselves | ||||
| 	m.GenericAPIServer.PrepareRun() | ||||
| 	m.GenericAPIServer.RunPostStartHooks() | ||||
|  | ||||
| 	cfg := *masterConfig.GenericConfig.LoopbackClientConfig | ||||
| 	cfg.ContentConfig.GroupVersion = &unversioned.GroupVersion{} | ||||
| 	privilegedClient, err := restclient.RESTClientFor(&cfg) | ||||
| @@ -254,12 +260,6 @@ func startMasterOrDie(masterConfig *master.Config, incomingServer *httptest.Serv | ||||
| 		glog.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	// TODO have this start method actually use the normal start sequence for the API server | ||||
| 	// this method never actually calls the `Run` method for the API server | ||||
| 	// fire the post hooks ourselves | ||||
| 	m.GenericAPIServer.PrepareRun() | ||||
| 	m.GenericAPIServer.RunPostStartHooks() | ||||
|  | ||||
| 	// wait for services to be ready | ||||
| 	if masterConfig.EnableCoreControllers { | ||||
| 		// TODO Once /healthz is updated for posthooks, we'll wait for good health | ||||
| @@ -350,6 +350,7 @@ func NewMasterConfig() *master.Config { | ||||
| 	genericConfig.APIResourceConfigSource = master.DefaultAPIResourceConfigSource() | ||||
| 	genericConfig.Authorizer = authorizer.NewAlwaysAllowAuthorizer() | ||||
| 	genericConfig.AdmissionControl = admit.NewAlwaysAdmit() | ||||
| 	genericConfig.EnableMetrics = true | ||||
|  | ||||
| 	return &master.Config{ | ||||
| 		GenericConfig:         genericConfig, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user