Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage applications running in the cluster and troubleshoot them, as well as manage the cluster itself.
IMPORTANT: Read the Access Control guide before performing any further steps. The default Dashboard deployment contains a minimal set of RBAC privileges needed to run.
To deploy Dashboard, execute following command:
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
To access Dashboard from your local workstation you must create a secure channel to your Kubernetes cluster. Run the following command:
$ kubectl proxy
Now access Dashboard at:
can also use NodePort service type to expose the port then can access by public IP with port below using port 31630 so can access by using https://x.x.x.x:31630
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
type: NodePort #add here manually
ports:
- nodePort: 31630 #hardcode
port: 443
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
in v1 version using below command
$ mkdir certs
$ openssl req -nodes -newkey rsa:2048 -keyout certs/dashboard.key -out certs/dashboard.csr -subj "/C=/ST=/L=/O=/OU=/CN=kubernetes-dashboard"
$ openssl x509 -req -sha256 -days 365 -in certs/dashboard.csr -signkey certs/dashboard.key -out certs/dashboard.crt
$ kubectl create secret generic kubernetes-dashboard-certs --from-file=certs -n kube-system
$ kubectl create -f kubernetes-dashboard.yaml
in v2 create namespace kubernetes-dashboard first then apply the yaml file
before apply the yaml file
`$ openssl req -nodes -newkey rsa:2048 -keyout certs/dashboard.key -out certs/dashboard.csr -subj "/C=/ST=/L=/O=/OU=/CN=kubernetes-dashboard"`
`$ openssl x509 -req -sha256 -days 365 -in certs/dashboard.csr -signkey certs/dashboard.key -out certs/dashboard.crt`
create the namespace first
`$ kubectl create namespace kubernetes-dashboard`
then create the screct
`$ kubectl create secret generic kubernetes-dashboard-certs --from-file=certs -n kubernetes-dashboard`
then apply the yaml file, even it will show error secret and namespace exist
`$ kubectl create -f kubernetes-dashboard.yaml
serviceaccount/kubernetes-dashboard created
service/kubernetes-dashboard created
secret/kubernetes-dashboard-csrf created
secret/kubernetes-dashboard-key-holder created
configmap/kubernetes-dashboard-settings created
role.rbac.authorization.k8s.io/kubernetes-dashboard created
clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
deployment.apps/kubernetes-dashboard created
service/dashboard-metrics-scraper created
deployment.apps/dashboard-metrics-scraper created
Error from server (AlreadyExists): error when creating "kubernetes-dashboard.yaml": namespaces "kubernetes-dashboard" already exists
Error from server (AlreadyExists): error when creating "kubernetes-dashboard.yaml": secrets "kubernetes-dashboard-certs" already exists`
xxxxxmy@k8s-master:~/course/dashboard$ kubectl get svc -n kubernetes-dashboard
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
dashboard-metrics-scraper ClusterIP 10.98.37.58 <none> 8000/TCP 18h
kubernetes-dashboard NodePort 10.100.164.171 <none> 443:31630/TCP 18h
To find out how to create sample user and log in follow Creating sample user guide.
NOTE:
- Kubeconfig Authentication method does not support external identity providers or certificate-based authentication.
- Dashboard can only be accessed over HTTPS
- Heapster has to be running in the cluster for the metrics and graphs to be available. Read more about it in Integrations guide.
Dashboard documentation can be found on docs directory which contains:
- Common: Entry-level overview
- User Guide: Installation, Accessing Dashboard and more for users
- Developer Guide: Getting Started, Dependency Management and more for anyone interested in contributing
Learn how to engage with the Kubernetes community on the community page.
You can reach the maintainers of this project at:
Learn how to start contribution on the Contributing Guidline
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.
Copyright 2019 The Kubernetes Dashboard Authors