Add kube-ui cluster addon for serving k8s dashboard UI.

Changes include:
- Add kube-ui binary for serving static dashboard UI
- Add kube-ui docker image, replication controller, and service
- Make the kube-ui a cluster-addon (enabled by default)
- Split the compiled pkg/ui/datafile.go into separate dashboard and swagger packages
- Update docs to reflect changes
This commit is contained in:
Tim St. Clair
2015-06-11 17:45:17 -07:00
parent 7689391c68
commit b6b2d6df42
15 changed files with 22305 additions and 21811 deletions

View File

@@ -20,6 +20,9 @@ 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"
)
@@ -38,7 +41,11 @@ func InstallSupport(mux MuxInterface, enableSwaggerSupport bool) {
mime.AddExtensionType(".svg", "image/svg+xml")
// Expose files in www/ on <host>/static/
fileServer := http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "www"})
fileServer := http.FileServer(&assetfs.AssetFS{
Asset: dashboard.Asset,
AssetDir: dashboard.AssetDir,
Prefix: "www",
})
prefix := "/static/"
mux.Handle(prefix, http.StripPrefix(prefix, fileServer))
prefix = "/ui/"
@@ -48,7 +55,11 @@ func InstallSupport(mux MuxInterface, enableSwaggerSupport bool) {
if enableSwaggerSupport {
// Expose files in third_party/swagger-ui/ on <host>/swagger-ui
fileServer = http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "third_party/swagger-ui"})
fileServer = http.FileServer(&assetfs.AssetFS{
Asset: swagger.Asset,
AssetDir: swagger.AssetDir,
Prefix: "third_party/swagger-ui",
})
prefix = "/swagger-ui/"
mux.Handle(prefix, http.StripPrefix(prefix, fileServer))
}