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

9
pkg/ui/data/README.md Normal file
View File

@@ -0,0 +1,9 @@
The datafiles contained in these directories were generated by the script
```sh
hack/build-ui.sh
```
Do not edit by hand.
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/pkg/ui/data/README.md?pixel)]()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// package ui contains static data files compiled to go, and utilities for accessing them.
// package ui contains utilities for accessing the static data files compiled in
// the data/* subdirectories.
package ui

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))
}