1.安裝 Docker Desktop for windows
2.查看Kubernetes版本
3.配置docker鏡像源,和第4步配合使用,這裏要配置阿里雲的鏡像
4. 下載k8s環境配置工具的代碼
https://github.com/AliyunContainerService/k8s-for-docker-desktop.git
5.執行PowerShell
在Windows 10上,使用管理員執行 PowerShell,進入第三步下載的代碼目錄
.\load_images.ps1
6. 驗證 Kubernetes 集羣狀態
kubectl cluster-info
kubectl get nodes
7. 配置 Kubernetes 控制檯
部署 Kubernetes dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
8. 開啓 API Server 訪問代理
kubectl proxy
9. 通過如下 URL 訪問 Kubernetes dashboard
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
10. 配置控制檯訪問令牌
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
kubectl config set-credentials docker-for-desktop --token="${TOKEN}"
echo $TOKEN
把TOKEN的值複製到輸入令牌處
或者選擇 Kubeconfig 文件,路徑如下:
Win: %UserProfile%\.kube\config
點擊登陸,進入Kubernetes Dashboard