Allow disabling non-necessary kubelet and apiserver endpoints

This commit is contained in:
Haney Maxwell
2014-10-09 16:26:34 -07:00
parent 1a1b0699bc
commit c0bf974871
6 changed files with 50 additions and 32 deletions

View File

@@ -121,12 +121,16 @@ func (g *APIGroup) InstallREST(mux mux, paths ...string) {
// InstallSupport registers the APIServer support functions into a mux.
func InstallSupport(mux mux) {
healthz.InstallHandler(mux)
mux.Handle("/logs/", http.StripPrefix("/logs/", http.FileServer(http.Dir("/var/log/"))))
mux.Handle("/proxy/minion/", http.StripPrefix("/proxy/minion", http.HandlerFunc(handleProxyMinion)))
mux.HandleFunc("/version", handleVersion)
mux.HandleFunc("/", handleIndex)
}
// InstallLogsSupport registers the APIServer log support function into a mux.
func InstallLogsSupport(mux mux) {
mux.Handle("/logs/", http.StripPrefix("/logs/", http.FileServer(http.Dir("/var/log/"))))
}
// handleVersion writes the server's version information.
func handleVersion(w http.ResponseWriter, req *http.Request) {
writeRawJSON(http.StatusOK, version.Get(), w)