mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Add a /healthz handler to the kubelet server, so that the master can validate kubelet health.
This commit is contained in:
parent
dcbb309e4f
commit
9f99767b6c
@ -58,6 +58,10 @@ func (s *KubeletServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
switch {
|
||||
case u.Path == "/healthz":
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("ok"))
|
||||
return
|
||||
case u.Path == "/container" || u.Path == "/containers":
|
||||
defer req.Body.Close()
|
||||
data, err := ioutil.ReadAll(req.Body)
|
||||
|
Loading…
Reference in New Issue
Block a user