mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 18:28:13 +00:00 
			
		
		
		
	kubelet: remove the pleg health check from healthz/
If docker hangs, we don't want kubelet to get killed as well.
This commit is contained in:
		| @@ -2026,11 +2026,6 @@ func (kl *Kubelet) LatestLoopEntryTime() time.Time { | ||||
| 	return val.(time.Time) | ||||
| } | ||||
|  | ||||
| // PLEGHealthCheck returns whether the PLEG is healthy. | ||||
| func (kl *Kubelet) PLEGHealthCheck() (bool, error) { | ||||
| 	return kl.pleg.Healthy() | ||||
| } | ||||
|  | ||||
| // updateRuntimeUp calls the container runtime status callback, initializing | ||||
| // the runtime dependent modules when the container runtime first comes up, | ||||
| // and returns an error if the status check fails.  If the status check is OK, | ||||
|   | ||||
| @@ -182,7 +182,6 @@ type HostInterface interface { | ||||
| 	ImagesFsInfo() (cadvisorapiv2.FsInfo, error) | ||||
| 	RootFsInfo() (cadvisorapiv2.FsInfo, error) | ||||
| 	ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) | ||||
| 	PLEGHealthCheck() (bool, error) | ||||
| 	GetExec(podFullName string, podUID types.UID, containerName string, cmd []string, streamOpts remotecommand.Options) (*url.URL, error) | ||||
| 	GetAttach(podFullName string, podUID types.UID, containerName string, streamOpts remotecommand.Options) (*url.URL, error) | ||||
| 	GetPortForward(podName, podNamespace string, podUID types.UID) (*url.URL, error) | ||||
| @@ -257,7 +256,6 @@ func (s *Server) InstallDefaultHandlers() { | ||||
| 	healthz.InstallHandler(s.restfulCont, | ||||
| 		healthz.PingHealthz, | ||||
| 		healthz.NamedCheck("syncloop", s.syncLoopHealthCheck), | ||||
| 		healthz.NamedCheck("pleg", s.plegHealthCheck), | ||||
| 	) | ||||
| 	var ws *restful.WebService | ||||
| 	ws = new(restful.WebService) | ||||
| @@ -417,14 +415,6 @@ func (s *Server) syncLoopHealthCheck(req *http.Request) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Checks if pleg, which lists pods periodically, is healthy. | ||||
| func (s *Server) plegHealthCheck(req *http.Request) error { | ||||
| 	if ok, err := s.host.PLEGHealthCheck(); !ok { | ||||
| 		return fmt.Errorf("PLEG took longer than expected: %v", err) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // getContainerLogs handles containerLogs request against the Kubelet | ||||
| func (s *Server) getContainerLogs(request *restful.Request, response *restful.Response) { | ||||
| 	podNamespace := request.PathParameter("podNamespace") | ||||
|   | ||||
| @@ -159,8 +159,6 @@ func (fk *fakeKubelet) StreamingConnectionIdleTimeout() time.Duration { | ||||
| 	return fk.streamingConnectionIdleTimeoutFunc() | ||||
| } | ||||
|  | ||||
| func (fk *fakeKubelet) PLEGHealthCheck() (bool, error) { return fk.plegHealth, nil } | ||||
|  | ||||
| // Unused functions | ||||
| func (_ *fakeKubelet) GetContainerInfoV2(_ string, _ cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) { | ||||
| 	return nil, nil | ||||
| @@ -869,18 +867,6 @@ func TestSyncLoopCheck(t *testing.T) { | ||||
| 	assertHealthFails(t, fw.testHTTPServer.URL+"/healthz", http.StatusInternalServerError) | ||||
| } | ||||
|  | ||||
| func TestPLEGHealthCheck(t *testing.T) { | ||||
| 	fw := newServerTest() | ||||
| 	defer fw.testHTTPServer.Close() | ||||
| 	fw.fakeKubelet.hostnameFunc = func() string { | ||||
| 		return "127.0.0.1" | ||||
| 	} | ||||
|  | ||||
| 	// Test with failed pleg health check. | ||||
| 	fw.fakeKubelet.plegHealth = false | ||||
| 	assertHealthFails(t, fw.testHTTPServer.URL+"/healthz", http.StatusInternalServerError) | ||||
| } | ||||
|  | ||||
| // returns http response status code from the HTTP GET | ||||
| func assertHealthIsOk(t *testing.T, httpURL string) { | ||||
| 	resp, err := http.Get(httpURL) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu-Ju Hong
					Yu-Ju Hong