minikube dashboard
- Docker & Kubernetes course
- Intermediate
- Lesson 11/82
- 4 min
Learn to open the web UI with minikube dashboard.
minikube dashboard
The Kubernetes Dashboard is a web interface that shows the objects in the cluster in a browser: deployments, pods, logs, events. minikube dashboard enables the add-on, starts a proxy and opens the browser:
$ minikube dashboard --url
🤔 Verifying dashboard health ...
🚀 Launching proxy ...
http://127.0.0.1:43215/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/The command keeps the terminal busy; Ctrl+C closes the proxy.
The command-line alternative
Everything the Dashboard shows can also be seen with kubectl. Events are the fastest way to understand why something didn't happen:
kubectl get all # basic objects
kubectl get events --sort-by=.metadata.creationTimestamp | tail -5
kubectl logs deploy/web --tail=20Terminal interfaces like k9s are also a lightweight alternative to the dashboard.
Practice Dashboard and events
Write three commands: print the dashboard address without opening a browser; list all the basic objects (get all); list the events sorted by .metadata.creationTimestamp.
Starter code
# buraya yazSample solution
minikube dashboard --url
kubectl get all
kubectl get events --sort-by=.metadata.creationTimestampExpected output
http://127.0.0.1:43215/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ NAME READY STATUS RESTARTS AGE pod/web-7c5b9f6d8-abcde 1/1 Running 0 5m LAST SEEN TYPE REASON OBJECT MESSAGE 5m Normal Pulled pod/web-7c5b9f6d8-abcde Container image "nginx:1.27" already present
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Why is the Dashboard opened carefully on production clusters?
- It requires a license
- Opened with broad permissions, it allows managing the whole cluster Correct answer
- It is very slow
- It deletes pods
Explanation: Dashboards left open have led to crypto-mining attacks in the past.
2 Sort the events by creation time.
kubectl get events ____=.metadata.creationTimestamp
kubectl get events --sort-by=.metadata.creationTimestamp
Explanation: --sort-by sorts by a JSONPath field.
3 Match.
| Term | Meaning |
|---|---|
minikube dashboard |
Web interface |
--url |
Don't open the browser |
kubectl get events |
Events |
k9s |
Terminal interface |