graywen24 / dashboard

General-purpose web UI for Kubernetes clusters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kubernetes Dashboard

Build Status Go Report Card Coverage Status GitHub release License

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.

Dashboard UI workloads page

Getting Started

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:

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/.

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

yaml file edit

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

Create An Authentication Token (RBAC)

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.

Documentation

Dashboard documentation can be found on docs directory which contains:

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Contribution

Learn how to start contribution on the Contributing Guidline

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

License

Apache License 2.0


Copyright 2019 The Kubernetes Dashboard Authors

About

General-purpose web UI for Kubernetes clusters

License:Apache License 2.0


Languages

Language:Go 53.9%Language:TypeScript 26.6%Language:HTML 13.9%Language:CSS 2.5%Language:JavaScript 1.7%Language:Shell 1.1%Language:Dockerfile 0.2%