Commit 7a47ea89 authored by Dawn Chen's avatar Dawn Chen

Ask monit health check kubelet; if failed, restart.

parent 43b4f412
......@@ -3,4 +3,7 @@ group kubelet
start program = "/etc/init.d/kubelet start"
stop program = "/etc/init.d/kubelet stop"
if does not exist then restart
if failed port 10250
protocol HTTP request "/healthz"
with timeout 10 seconds
then restart
......@@ -165,13 +165,11 @@ func (s *Server) handleHealthz(w http.ResponseWriter, req *http.Request) {
// Check that the hostname known by the master matches the hostname
// the kubelet knows
/*
hostname := s.host.GetHostname()
if masterHostname != hostname {
s.error(w, errors.New("Kubelet hostname \""+hostname+"\" does not match the hostname expected by the master \""+masterHostname+"\""))
return
}
*/
hostname := s.host.GetHostname()
if masterHostname != hostname && masterHostname != "127.0.0.1" && masterHostname != "localhost" {
s.error(w, errors.New("Kubelet hostname \""+hostname+"\" does not match the hostname expected by the master \""+masterHostname+"\""))
return
}
w.Write([]byte("ok"))
}
......
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