From 78609986b95d00420c3779d238744e160f55ae54 Mon Sep 17 00:00:00 2001 From: "Tim St. Clair" Date: Thu, 18 Jun 2015 18:13:39 -0700 Subject: [PATCH] Remove dashboard ui from apiserver & point /ui at kube-ui --- docs/ui.md | 4 ++-- pkg/ui/installsupport.go | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/ui.md b/docs/ui.md index 62b1d6fecb5..84fe59f23c5 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -12,9 +12,9 @@ kubectl proxy --www=www/app --www-prefix=/ You should now be able to access it by visiting [localhost:8001](http://localhost:8001/). -You can also use other web servers to serve the contents of the www/app directory, as described [here](../www/README.md#serving-the-app-during-development). +You can also use other web servers to serve the contents of the www/app directory, as described [here](../www/README.md#serving-the-app-during-development). ### Running remotely -When Kubernetes is deployed remotely, the api server deploys the UI. To access it, visit `/ui`, which redirects to `/api/v1/proxy/namespaces/default/services/kube-ui/#/dashboard/`, on your master server. +When Kubernetes is deployed remotely, the UI is deployed as a cluster addon. To access it, visit `/ui`, which redirects to `/api/v1/proxy/namespaces/default/services/kube-ui/#/dashboard/`, on your master server. [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/ui.md?pixel)]() diff --git a/pkg/ui/installsupport.go b/pkg/ui/installsupport.go index d8a360b30e7..93b19ac257a 100644 --- a/pkg/ui/installsupport.go +++ b/pkg/ui/installsupport.go @@ -20,13 +20,12 @@ import ( "mime" "net/http" - "github.com/GoogleCloudPlatform/kubernetes/pkg/ui/data/dashboard" "github.com/GoogleCloudPlatform/kubernetes/pkg/ui/data/swagger" assetfs "github.com/elazarl/go-bindata-assetfs" ) -const dashboardPath = "/static/app/#/dashboard/" +const dashboardPath = "/api/v1/proxy/namespaces/default/services/kube-ui/#/dashboard/" type MuxInterface interface { Handle(pattern string, handler http.Handler) @@ -40,22 +39,15 @@ func InstallSupport(mux MuxInterface, enableSwaggerSupport bool) { // makes it into all of our supported go versions. mime.AddExtensionType(".svg", "image/svg+xml") - // Expose files in www/ on /static/ - fileServer := http.FileServer(&assetfs.AssetFS{ - Asset: dashboard.Asset, - AssetDir: dashboard.AssetDir, - Prefix: "www", - }) - prefix := "/static/" - mux.Handle(prefix, http.StripPrefix(prefix, fileServer)) - prefix = "/ui/" + // Redirect /ui to the kube-ui proxy path + prefix := "/ui/" mux.HandleFunc(prefix, func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, dashboardPath, http.StatusTemporaryRedirect) }) if enableSwaggerSupport { // Expose files in third_party/swagger-ui/ on /swagger-ui - fileServer = http.FileServer(&assetfs.AssetFS{ + fileServer := http.FileServer(&assetfs.AssetFS{ Asset: swagger.Asset, AssetDir: swagger.AssetDir, Prefix: "third_party/swagger-ui",