Merge pull request #13329 from swagiaal/remove-hostname-health-check

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-08-28 21:48:37 -07:00
commit d92daf6988

View File

@ -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