This article provides a step-by-step guide on setting up a Kubernetes (K8s) dashboard on Docker Desktop for Mac. It covers the entire process from building the Docker Desktop K8s environment to creating a dashboard, generating access tokens, and logging in.
Download DockerDeskTop
The procedures utilize Alibaba Cloud’s Kubernetes GitHub project, offering practical insights for developers working with containerized applications in a Mac environment.”
1
| https://www.docker.com/products/docker-desktop/
|
Use ALiYun K8s for deskTop
1
2
3
4
5
| git clone https://github.com/AliyunContainerService/k8s-for-docker-desktop.git
cd k8s-for-docker-desktop
./load_images.sh
|
Change user Context
1
| kubectl config use-context docker-desktop
|
GetClusterInfo
1
2
| kubectl cluster-info
kubectl get nodes
|
CreateDashboard
1
2
3
| kubectl create -f kubernetes-dashboard.yaml
kubectl get pod -n kubernetes-dashboard
kubectl proxy
|
BuildToken
1
2
3
4
| kubectl apply -f kube-system-default.yaml
TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')
kubectl config set-credentials docker-desktop --token="${TOKEN}"
echo $TOKEN
|
Dashboard Login
1
2
| http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
|
Quote
- Mac + Docker + K8S 本地搭建K8S集群
Comments powered by Disqus.