k8s dashboard for kind
It was a kind š of weird, handle all the Kubernetes (k8s) commands on my local environment and then I decided to install the k8s dashboard.
What kind of problem the dashboard solve?
Solve the problem to see a GUI instead of CLI. Although help when youāre starting on k8s and/or wonāt have in mind all k8s commands, there are so many, check it out.
Assumptions
- Has Helm installed
- Youāre using kind
- If youāre using other local k8s, such as Minikube check the section Minikube.
How to configure?
Install the dashboard using the following steps:
- Helm install
helm install dashboard kubernetes-dashboard/kubernetes-dashboard -n kubernetes-dashboard --create-namespace
2. Initiate the proxy
kubectl proxy
3. Access the login page
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:dashboard-kubernetes-dashboard:https/proxy/#/login
4. Create an authentication token
For it, deploy the content below, saving it as file, such as service-account.yml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
4.1 k8s create object
kubectl apply -f "file path + file name"
4.2 Describe the user
The command below will describe the user, please pick the user that have this pattern āadmin-user-token<>ā, on the name āTokensā, in this example admin-user-token-lgr7w.
// First command
kubectl describe serviceaccount admin-user -n kubernetes-dashboard// Second command
kubectl describe secret admin-user-token-lgr7w -n kubernetes-dashboard
Copy the content starting on āey..ā until ā..Z1gā, i.e., the token content.
5. Access
Choose the authentication by Token, and use the content copied from the previous step and past into the blank field, and hit the Sign in button.
6. Dashboard
After the steps, habemus access to dashboard, now itās time to play š»
Minikube
For minikube click here.