0
0
Kubernetesdevops~10 mins

Kubernetes dashboard - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Kubernetes dashboard
Start Kubernetes Cluster
Deploy Dashboard Manifest
Create Service Account & Role
Access Dashboard via Proxy or Token
Dashboard UI Loads
User Interacts with Cluster Resources
Dashboard Shows Cluster State & Metrics
This flow shows how the Kubernetes dashboard is deployed, accessed, and used to view and manage cluster resources.
Execution Sample
Kubernetes
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
kubectl proxy
# Access dashboard at http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
# Use token from service account for login
This code deploys the Kubernetes dashboard, starts a proxy to access it locally, and shows how to open the dashboard in a browser.
Process Table
StepCommand/ActionResult/OutputSystem State Change
1kubectl apply -f dashboard.yamldeployment.apps/kubernetes-dashboard created service/kubernetes-dashboard createdDashboard components deployed in cluster
2kubectl create serviceaccount dashboard-admin-sa -n kubernetes-dashboardserviceaccount/dashboard-admin-sa createdService account created for dashboard access
3kubectl create clusterrolebinding dashboard-admin-sa --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-admin-saclusterrolebinding.rbac.authorization.k8s.io/dashboard-admin-sa createdAdmin permissions granted to service account
4kubectl proxyStarting to serve on 127.0.0.1:8001Local proxy running to access cluster API
5Open browser at dashboard URLDashboard login page loadsUser can enter token to authenticate
6User enters token and logs inDashboard UI shows cluster resourcesDashboard connected and displaying cluster state
7User views pods, deployments, servicesDashboard shows live status and metricsUser can manage cluster resources via UI
8ExitUser closes dashboard or proxyDashboard access ends
💡 User closes proxy or dashboard, ending the session
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5After Step 6Final
Dashboard DeploymentNot DeployedDeployedDeployedDeployedDeployedDeployedDeployedDeployed
Service AccountNoneNoneCreatedCreatedCreatedCreatedCreatedCreated
Proxy StatusNot RunningNot RunningNot RunningNot RunningRunningRunningRunningStopped
User AuthenticatedNoNoNoNoNoNoYesNo
Key Moments - 3 Insights
Why do we need to create a service account and cluster role binding?
The dashboard needs permissions to view and manage cluster resources. Creating a service account with cluster-admin role (see steps 2 and 3 in execution_table) grants these permissions securely.
Why do we use 'kubectl proxy' to access the dashboard?
The dashboard runs inside the cluster and is not exposed externally by default. 'kubectl proxy' creates a secure local tunnel to the cluster API server, allowing safe access to the dashboard UI (step 4).
What happens if the user does not provide a token at login?
Without a valid token, the dashboard will not authenticate the user, so the UI will not load cluster data (step 6). The user must provide a token from the service account to proceed.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 4. What is the state of the proxy?
AProxy is running and serving on localhost
BProxy is not started yet
CProxy has stopped
DProxy is running but not serving
💡 Hint
Check the 'Result/Output' column at step 4 in execution_table
At which step does the dashboard UI become accessible to the user?
AStep 3
BStep 6
CStep 5
DStep 7
💡 Hint
Look for when the browser opens the dashboard URL in execution_table
If the service account was not created, what would happen at step 6?
ADashboard UI would load normally
BUser would be unable to authenticate and see cluster data
CProxy would fail to start
DDashboard deployment would fail
💡 Hint
Refer to key_moments about authentication and service account permissions
Concept Snapshot
Kubernetes Dashboard Quick Guide:
- Deploy with: kubectl apply -f recommended.yaml
- Create service account and clusterrolebinding for access
- Use 'kubectl proxy' to securely access dashboard locally
- Open browser at proxy URL to login
- Login with token from service account
- Dashboard shows cluster resources and metrics
- Manage cluster visually via dashboard UI
Full Transcript
The Kubernetes dashboard is a web UI to manage and monitor your cluster. First, you deploy the dashboard components using kubectl apply. Then, you create a service account with admin permissions so the dashboard can access cluster data. Next, you run 'kubectl proxy' to create a secure local connection to the cluster API. You open the dashboard URL in your browser, which shows a login page. You authenticate using a token from the service account. After login, the dashboard UI loads and displays cluster resources like pods and deployments. You can interact with these resources visually. When done, you close the proxy or dashboard to end the session.