Commit ccd0fcd1 authored by Sami Wagiaalla's avatar Sami Wagiaalla

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: 's avatarSami Wagiaalla <swagiaal@redhat.com>
parent 98801225
...@@ -130,7 +130,6 @@ func (s *Server) InstallDefaultHandlers() { ...@@ -130,7 +130,6 @@ func (s *Server) InstallDefaultHandlers() {
healthz.InstallHandler(s.restfulCont, healthz.InstallHandler(s.restfulCont,
healthz.PingHealthz, healthz.PingHealthz,
healthz.NamedCheck("docker", s.dockerHealthCheck), healthz.NamedCheck("docker", s.dockerHealthCheck),
healthz.NamedCheck("hostname", s.hostnameHealthCheck),
healthz.NamedCheck("syncloop", s.syncLoopHealthCheck), healthz.NamedCheck("syncloop", s.syncLoopHealthCheck),
) )
var ws *restful.WebService var ws *restful.WebService
...@@ -287,25 +286,6 @@ func (s *Server) dockerHealthCheck(req *http.Request) error { ...@@ -287,25 +286,6 @@ func (s *Server) dockerHealthCheck(req *http.Request) error {
return nil 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. // Checks if kubelet's sync loop that updates containers is working.
func (s *Server) syncLoopHealthCheck(req *http.Request) error { func (s *Server) syncLoopHealthCheck(req *http.Request) error {
duration := s.host.ResyncInterval() * 2 duration := s.host.ResyncInterval() * 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment