From ccd0fcd1f9ab6b5fd41160bffc3d087e8bfb6c64 Mon Sep 17 00:00:00 2001 From: Sami Wagiaalla Date: Fri, 28 Aug 2015 16:53:02 -0400 Subject: [PATCH] Rmove Hostname health check The health check is no longer needed since health checks are no longer run by master but updated by the kubelet; so a host with the incorrect host name will not be updated and show 'NotReady' status Signed-off-by: Sami Wagiaalla --- pkg/kubelet/server.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkg/kubelet/server.go b/pkg/kubelet/server.go index ffc3f62e979..d60376caeb1 100644 --- a/pkg/kubelet/server.go +++ b/pkg/kubelet/server.go @@ -130,7 +130,6 @@ func (s *Server) InstallDefaultHandlers() { healthz.InstallHandler(s.restfulCont, healthz.PingHealthz, healthz.NamedCheck("docker", s.dockerHealthCheck), - healthz.NamedCheck("hostname", s.hostnameHealthCheck), healthz.NamedCheck("syncloop", s.syncLoopHealthCheck), ) var ws *restful.WebService @@ -287,25 +286,6 @@ func (s *Server) dockerHealthCheck(req *http.Request) error { return nil } -func (s *Server) hostnameHealthCheck(req *http.Request) error { - masterHostname, _, err := net.SplitHostPort(req.Host) - if err != nil { - if !strings.Contains(req.Host, ":") { - masterHostname = req.Host - } else { - return fmt.Errorf("Could not parse hostname from http request: %v", err) - } - } - - // Check that the hostname known by the master matches the hostname - // the kubelet knows - hostname := s.host.GetHostname() - if masterHostname != hostname && masterHostname != "127.0.0.1" && masterHostname != "localhost" { - return fmt.Errorf("Kubelet hostname \"%v\" does not match the hostname expected by the master \"%v\"", hostname, masterHostname) - } - return nil -} - // Checks if kubelet's sync loop that updates containers is working. func (s *Server) syncLoopHealthCheck(req *http.Request) error { duration := s.host.ResyncInterval() * 2