Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set kubernetes-dashboard as the default UI addon #20330

Merged
merged 1 commit into from
Feb 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions cluster/addons/dashboard/MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Maintainers

Piotr Bryk <bryk@google.com> and committers to the https://github.com/kubernetes/dashboard repository.


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/dashboard/MAINTAINERS.md?pixel)]()
11 changes: 11 additions & 0 deletions cluster/addons/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Kubernetes Dashboard
==============

Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters.
It allows users to manage applications running in the cluster, troubleshoot them,
as well as manage the cluster itself.

Learn more at: https://github.com/kubernetes/dashboard


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/dashboard/README.md?pixel)]()
39 changes: 39 additions & 0 deletions cluster/addons/dashboard/dashboard-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v1
kind: ReplicationController
metadata:
# Keep the name in sync with image version and
# gce/coreos/kube-manifests/addons/dashboard counterparts
name: kubernetes-dashboard-v0.1.0
namespace: kube-system
labels:
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v0.1.0
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 50Mi
requests:
cpu: 100m
memory: 50Mi
ports:
- containerPort: 9090
livenessProbe:
httpGet:
path: /
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: kube-ui
name: kubernetes-dashboard
namespace: kube-system
labels:
k8s-app: kube-ui
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeUI"
spec:
selector:
k8s-app: kube-ui
k8s-app: kubernetes-dashboard
ports:
- port: 80
targetPort: 8080
targetPort: 9090
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-ui-v5
name: kubernetes-dashboard-v0.1.0
namespace: kube-system
labels:
k8s-app: kube-ui
version: v5
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
k8s-app: kube-ui
version: v5
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kube-ui
version: v5
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: kube-ui
image: gcr.io/google_containers/kube-ui:v5
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v0.1.0
resources:
# keep request = limit to keep this container in guaranteed class
limits:
Expand All @@ -31,10 +28,10 @@ spec:
cpu: 100m
memory: 50Mi
ports:
- containerPort: 8080
- containerPort: 9090
livenessProbe:
httpGet:
path: /
port: 8080
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 5
timeoutSeconds: 30
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: kube-ui
name: kubernetes-dashboard
namespace: kube-system
labels:
k8s-app: kube-ui
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeUI"
spec:
selector:
k8s-app: kube-ui
k8s-app: kubernetes-dashboard
ports:
- port: 80
targetPort: 8080
targetPort: 9090
36 changes: 0 additions & 36 deletions cluster/gce/coreos/kube-manifests/addons/kube-ui/kube-ui-rc.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions cluster/mesos/docker/deploy-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd)
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/${KUBE_CONFIG_FILE-"config-default.sh"}"
kubectl="${KUBE_ROOT}/cluster/kubectl.sh"

"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/kube-ui/kube-ui-rc.yaml"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/kube-ui/kube-ui-svc.yaml"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/dashboard/dashboard-controller.yaml"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/dashboard/dashboard-service.yaml"
4 changes: 2 additions & 2 deletions cluster/mesos/docker/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function kube-up {

# Wait for addons to deploy
cluster::mesos::docker::await_ready "kube-dns" "${MESOS_DOCKER_ADDON_TIMEOUT}"
cluster::mesos::docker::await_ready "kube-ui" "${MESOS_DOCKER_ADDON_TIMEOUT}"
cluster::mesos::docker::await_ready "kubernetes-dashboard" "${MESOS_DOCKER_ADDON_TIMEOUT}"

trap - EXIT
}
Expand All @@ -302,7 +302,7 @@ function validate-cluster {

# Validate immediate cluster reachability and responsiveness
echo "KubeDNS: $(cluster::mesos::docker::addon_status 'kube-dns')"
echo "KubeUI: $(cluster::mesos::docker::addon_status 'kube-ui')"
echo "Kubernetes Dashboard: $(cluster::mesos::docker::addon_status 'kubernetes-dashboard')"
}

# Delete a kubernetes cluster
Expand Down
4 changes: 2 additions & 2 deletions cluster/saltbase/salt/kube-addons/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ addon-dir-create:
{% endif %}

{% if pillar.get('enable_cluster_ui', '').lower() == 'true' %}
/etc/kubernetes/addons/kube-ui:
/etc/kubernetes/addons/dashboard:
file.recurse:
- source: salt://kube-addons/kube-ui
- source: salt://kube-addons/dashboard
- include_pat: E@^.+\.yaml$
- user: root
- group: root
Expand Down
Binary file removed docs/user-guide/k8s-ui-explore-filter.png
Binary file not shown.
Binary file removed docs/user-guide/k8s-ui-explore-groupby.png
Binary file not shown.
Binary file removed docs/user-guide/k8s-ui-explore-poddetail.png
Binary file not shown.
Binary file removed docs/user-guide/k8s-ui-explore.png
Binary file not shown.
Binary file removed docs/user-guide/k8s-ui-nodes.png
Binary file not shown.
Binary file removed docs/user-guide/k8s-ui-overview.png
Binary file not shown.
Binary file added docs/user-guide/ui-dashboard-deploy-more.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user-guide/ui-dashboard-deploy-simple.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user-guide/ui-dashboard-rcs-detail.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user-guide/ui-dashboard-rcs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user-guide/ui-dashboard-zerostate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 48 additions & 29 deletions docs/user-guide/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,56 +32,75 @@ Documentation for other releases can be found at

<!-- END MUNGE: UNVERSIONED_WARNING -->

# Kubernetes User Interface
# Kubernetes Dashboard User Interface

Kubernetes has a web-based user interface that displays the current cluster state graphically.
Kubernetes has a web-based user interface that allows users to manage applications running in
the cluster, troubleshoot them, as well as manage the cluster itself.

## Accessing the UI
## Accessing the Dashboard

By default, the Kubernetes UI is deployed as a cluster addon. To access it, visit `https://<kubernetes-master>/ui`, which redirects to `https://<kubernetes-master>/api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/`.
By default, the Kubernetes Dashboard is deployed as a cluster addon. To access it, visit
`https://<kubernetes-master>/ui`, which redirects to
`https://<kubernetes-master>/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard`.

If you find that you're not able to access the UI, it may be because the kube-ui service has not been started on your cluster. In that case, you can start it manually with:
If you find that you're not able to access the Dashboard, it may be because the kubernetes-dashboard
service has not been started on your cluster. In that case, you can start it manually with:

```sh
kubectl create -f cluster/addons/kube-ui/kube-ui-rc.yaml --namespace=kube-system
kubectl create -f cluster/addons/kube-ui/kube-ui-svc.yaml --namespace=kube-system
kubectl create -f cluster/addons/dashboard/dashboard-controller.yaml --namespace=kube-system
kubectl create -f cluster/addons/dashboard/dashboard-service.yaml --namespace=kube-system
```

Normally, this should be taken care of automatically by the [`kube-addons.sh`](http://releases.k8s.io/HEAD/cluster/saltbase/salt/kube-addons/kube-addons.sh) script that runs on the master.
Normally, this should be taken care of automatically by the
[`kube-addons.sh`](http://releases.k8s.io/HEAD/cluster/saltbase/salt/kube-addons/kube-addons.sh)
script that runs on the master. Release notes and development versions of the Dashboard can be
found at https://github.com/kubernetes/dashboard/releases.

## Using the UI
## Overview

The Kubernetes UI can be used to introspect your current cluster, such as checking how resources are used, or looking at error messages. You cannot, however, use the UI to modify your cluster.
The Dashboard can be used to introspect a cluster, such as show applications running on the
cluster, or surface problems in in the state of services. You can also use the UI to modify
your cluster. For example, you can deploy applications or change their number of replicas.

### Node Resource Usage
### Using the Dashboard

After accessing Kubernetes UI, you'll see a homepage dynamically listing out all nodes in your current cluster, with related information including internal IP addresses, CPU usage, memory usage, and file systems usage.
![Kubernetes UI home page](k8s-ui-overview.png)
When the accessed Dashboard works on an empty cluster, it shows welcome page with links to user
guide and documentation. It also allows to deploy to the cluster your first application.
![Kubernetes Dashboard welcome page](ui-dashboard-zerostate.png)

### Dashboard Views
### Deploying applications

Click on the "Views" button in the top-right of the page to see other views available, which include: Explore, Pods, Nodes, Replication Controllers, Services, and Events.
With Dashboard you can deploy a replicated application using a simple form that guides through all
required steps. All that is needed is a container image URI
(e.g., on Google Container Registry or Docker Hub) and knowledge on what ports the image exposes.
A replicated application that is deployed through the form is a replication controller plus optional
service (if port mappings are specified).

#### Explore View
![Kubernetes Dashboard deploy form](ui-dashboard-deploy-simple.png)

The "Explore" view allows your to see the pods, replication controllers, and services in current cluster easily.
![Kubernetes UI Explore View](k8s-ui-explore.png)
The "Group by" dropdown list allows you to group these resources by a number of factors, such as type, name, host, etc.
![Kubernetes UI Explore View - Group by](k8s-ui-explore-groupby.png)
You can also create filters by clicking on the down triangle of any listed resource instances and choose which filters you want to add.
![Kubernetes UI Explore View - Filter](k8s-ui-explore-filter.png)
To see more details of each resource instance, simply click on it.
![Kubernetes UI - Pod](k8s-ui-explore-poddetail.png)
The application deploy form has more options view where advanced configuration settings for the
deployed application can be changed, e.g., namespace or image pull secret.

### Other Views
![Kubernetes Dashboard deploy form advanced options](ui-dashboard-deploy-more.png)

Other views (Pods, Nodes, Replication Controllers, Services, and Events) simply list information about each type of resource. You can also click on any instance for more details.
![Kubernetes UI - Nodes](k8s-ui-nodes.png)
#### Applications view

## More Information
Main Dashboard view shows all applications that are running in the cluster. Applications are
denoted by cards that represent a replication controller plus zero or more services. Cards show
overview information of applications and allow for simple modifications (e.g., edit replica count)
and logs viewing. If error state is detected for a card, it is surfaced to the user.

![Kubernetes Dashboard applications view](ui-dashboard-rcs.png)

The application details page lists all replicas together with basic information about them.
The events page displays events that are related to replicas of the application.

For more information, see the [Kubernetes UI development document](http://releases.k8s.io/HEAD/www/README.md) in the www directory.
![Kubernetes Dashboard application detail](ui-dashboard-rcs-detail.png)

## More Information

For more information, see the
[Kubernetes Dashboard repository](https://github.com/kubernetes/dashboard).

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/ui.md?pixel)]()
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/installsupport.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
assetfs "github.com/elazarl/go-bindata-assetfs"
)

const dashboardPath = "/api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/"
const dashboardPath = "/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard"

type MuxInterface interface {
Handle(pattern string, handler http.Handler)
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/kube-ui.go → test/e2e/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ import (
. "github.com/onsi/gomega"
)

var _ = Describe("kube-ui", func() {
var _ = Describe("Kubernetes Dashboard", func() {
const (
uiServiceName = "kube-ui"
uiServiceName = "kubernetes-dashboard"
uiAppName = uiServiceName
uiNamespace = api.NamespaceSystem

serverStartTimeout = 1 * time.Minute
)

f := NewFramework("kube-ui")
f := NewFramework(uiServiceName)

It("should check that the kube-ui instance is alive", func() {
By("Checking the kube-ui service exists.")
It("should check that the kubernetes-dashboard instance is alive", func() {
By("Checking whether the kubernetes-dashboard service exists.")
err := waitForService(f.Client, uiNamespace, uiServiceName, true, poll, serviceStartTimeout)
Expect(err).NotTo(HaveOccurred())

By("Checking to make sure the kube-ui pods are running")
By("Checking to make sure the kubernetes-dashboard pods are running")
selector := labels.SelectorFromSet(labels.Set(map[string]string{"k8s-app": uiAppName}))
err = waitForPodsWithLabelRunning(f.Client, uiNamespace, selector)
Expect(err).NotTo(HaveOccurred())

By("Checking to make sure we get a response from the kube-ui.")
By("Checking to make sure we get a response from the kubernetes-dashboard.")
err = wait.Poll(poll, serverStartTimeout, func() (bool, error) {
var status int
// Query against the proxy URL for the kube-ui service.
Expand All @@ -63,7 +63,7 @@ var _ = Describe("kube-ui", func() {
StatusCode(&status).
Error()
if status != http.StatusOK {
Logf("Unexpected status from kube-ui: %v", status)
Logf("Unexpected status from kubernetes-dashboard: %v", status)
} else if err != nil {
Logf("Request to kube-ui failed: %v", err)
}
Expand Down