mirror of https://github.com/k3s-io/k3s
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 <swagiaal@redhat.com>pull/6/head
parent
98801225d6
commit
ccd0fcd1f9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue