mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
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:
9
pkg/ui/data/README.md
Normal file
9
pkg/ui/data/README.md
Normal 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.
|
||||
|
||||
|
||||
[]()
|
5004
pkg/ui/data/dashboard/datafile.go
Normal file
5004
pkg/ui/data/dashboard/datafile.go
Normal file
File diff suppressed because one or more lines are too long
17091
pkg/ui/data/swagger/datafile.go
Normal file
17091
pkg/ui/data/swagger/datafile.go
Normal file
File diff suppressed because one or more lines are too long
21793
pkg/ui/datafile.go
21793
pkg/ui/datafile.go
File diff suppressed because one or more lines are too long
@@ -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
|
||||
|
@@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user