0% found this document useful (0 votes)
32 views4 pages

Develop Intelligence Kubernetes Dashboard

Uploaded by

Vamsi Chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views4 pages

Develop Intelligence Kubernetes Dashboard

Uploaded by

Vamsi Chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Develop Intelligence Kubernetes Dashboard

Kubernetes Dashboard
• What is Kubernetes Dashboard
• Install Kubernetes Dashboard
• Access Kubernetes Dashboard
• Create An Authentication Token (RBAC)

Kubernetes Dashboard
Kubernetes dashboard is the official web-based UI for Kubernetes.
We can use Dashboard to get an overview of applications running on our cluster, as well as for creating or
modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets etc).
We can scale a Deployment, initiate a rolling update, restart a pod or deploy new applications using a deploy
wizard.

Dashboard also provides information on the state of Kubernetes resources in our cluster and on any errors that
may have occurred.:
• Overview of the Kubernetes cluster
• Deploy applications onto your Kubernetes clusters
• Get an overview of the applications running
• Troubleshoot those applications
• Get an overview of the resources running in the cluster
• Create, modify, update and delete Kubernetes resources
• Information about the state of the Kubernetes resources running in the cluster
• Basic resource metrics including resource usage for individual Kubernetes objects

Page 1 of 4
Develop Intelligence Kubernetes Dashboard

Install Kubernetes Dashboard


The Dashboard UI is not deployed by default. To deploy it, run the following command:
kubectl apply -f
https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml

The Dashboard related objects create created in kubenetes-dashboard namespace. We can see the objects
created for using the following command
kubectl get all -n kubernetes-dashboard

Access Kubernetes Dashboard


After we create the dashboard, we can access it using Kubectl. We need to start a proxy server between our
local machine and the Kubernetes apiserver. Run the command in a separate terminal.
Kubectl proxy
Kubectl proxy uses http for the connection between localhost and the proxy server and https for the connection
between the proxy and apiserver.

We can access the Kubernetes dashboard UI by browsing to the following url:


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

Create An Authentication Token (RBAC)


Step 1. Creating sample user
We need to create a new user using Service Account mechanism of Kubernetes, grant this user admin
permissions and login to Dashboard using bearer token tied to this user.
The objects required are of type ServiceAccount and ClusterRoleBinding in kubernetes-dashboard namespace.

dashboard-adminuser.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:

Page 2 of 4
Develop Intelligence Kubernetes Dashboard

apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard

Run the following command for the above yaml file


kubectl apply -f dashboard-adminuser.yaml
OR
kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --
serviceaccount=kube-system:kubernetes-dashboard

Step 2. Getting a Bearer Token


For Linux and MacOS:
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-
user | awk '{print $1}')

For Windows:
Powershell

kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | sls admin-
user | ForEach-Object { $_ -Split '\s+' } | Select -First 1)

It should print something like:


Name: admin-user-token-dq5sv
Namespace: kubernetes-dashboard
Labels: <none>
Annotations: kubernetes.io/service-account.name: admin-user
kubernetes.io/service-account.uid: 371db17f-c3fd-4b70-a16d-5e7d6c0edbf2
Type: kubernetes.io/service-account-token
Data
====
namespace: 20 bytes
token:
eyJhbGciOiJSUzI1NiIsImtpZCI6ImFneVc5Yklja3Fwck5EaTJKNGtILUt0Mk5lTU9qdjFWMTJ5eDlNeXJ5UjQifQ.eyJpc
3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3Bh

Page 3 of 4
Develop Intelligence Kubernetes Dashboard

Y2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5h
bWUiOiJhZG1pbi11c2VyLXRva2VuLWRxNXN2Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLW
FjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb
3VudC51aWQiOiIzNzFkYjE3Zi1jM2ZkLTRiNzAtYTE2ZC01ZTdkNmMwZWRiZjIiLCJzdWIiOiJzeXN0ZW06c2VydmljZ
WFjY291bnQ6a3ViZXJuZXRlcy1kYXNoYm9hcmQ6YWRtaW4tdXNlciJ9.ZFjGnDsX6lXuDxD3gDGexaCc0qfwj7CMps
lFlPOlczkxdnJP-VVA_PDtf4JwHP4bQb8cTKpYS4o1fSOzEzNI1eeQcpML-H1kS2K8tP5sr0lcY-
2cdi2zx52ojGjEdYa9t1Yg8dzdHQQ1apFSsHM1AZ5yfwKJEFJy-EjwLvMvF6eKDGsgVimmeCSnLL6qt5I0Kl-NY-
emW_2swSSyxVIK6m71YFgpFkb3aNHWpUtaC7gHBuS7xOgmd3-
sHKSrv2BhvuYud7W_GOmOwcAYR7ncf4o2bne2K3XjPJ0nmz2EEnalQR8dAeltbYOYSf-
CPCqrzm8fCszZZypfQWsIBJlduw
ca.crt: 1025 bytes

Copy the token and paste it into Enter token field on the login screen of Dashboard

Page 4 of 4

You might also like