Skip to content

Commit edd19ea

Browse files
committed
proxy:implement readyz and livez handlers
Signed-off-by: Nikita Rudakov <nikita.rudakov@sap.com>
1 parent c9acc4c commit edd19ea

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

pkg/proxy/server.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"k8s.io/apimachinery/pkg/util/wait"
2727
genericapifilters "k8s.io/apiserver/pkg/endpoints/filters"
2828
genericfilters "k8s.io/apiserver/pkg/server/filters"
29+
"k8s.io/apiserver/pkg/server/healthz"
2930
restclient "k8s.io/client-go/rest"
3031
"k8s.io/klog/v2"
3132

@@ -144,15 +145,8 @@ func NewServer(ctx context.Context, c CompletedConfig) (*Server, error) {
144145
handler = genericfilters.WithCORS(handler, c.Options.CorsAllowedOriginList, nil, nil, nil, "true")
145146

146147
mux := http.NewServeMux()
147-
// TODO: implement proper readyz handler
148-
mux.Handle("/readyz", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
149-
w.Write([]byte("OK")) //nolint:errcheck
150-
}))
151-
152-
// TODO: implement proper livez handler
153-
mux.Handle("/livez", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
154-
w.Write([]byte("OK")) //nolint:errcheck
155-
}))
148+
healthz.InstallReadyzHandler(mux, healthz.NewInformerSyncHealthz(s.KcpSharedInformerFactory))
149+
healthz.InstallLivezHandler(mux, healthz.PingHealthz)
156150

157151
mux.Handle("/", handler)
158152
s.Handler = mux

0 commit comments

Comments
 (0)