官网:https://www.docker.com/products/docker-desktop/
历史版本:https://download.docker.com/linux/static/stable/
注意设置好国内镜像地址,否则有些镜像拉去不下来
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
},
"insecure-registries": [
"10.146.200.22"
],
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
]
}
下载k8s-for-docker-desktop包
git clone https://github.com/AliyunContainerService/k8s-for-docker-desktop.git
cd k8s-for-docker-desktop
git branch -a
git checkout v1.25.4
.\load_images.ps1
or
./load_images.sh
Set-ExecutionPolicy RemoteSigned
解决方法:
1.管理员身份运行 PowerShell
2.执行:get-ExecutionPolicy,若显示 Restricted 表示状态是禁止的
3.执行:set-ExecutionPolicy,会提示输入参数
4.输入 RemoteSigned 会提示进行选择
5.输入:Y,回车
在Docker仪表盘上在Settings切到Kubernetes上启动Enabled Kubernetes
安装成功后左下角存在一个k8s的标志说明k8s已经在运行了。
获取所有的上下文。
kubectl config get-contexts
指定当前的上下文
kubectl config use-context docker-desktop
搜索kubernetes-dashboard.yaml的位置
打开kubernetes-dashboard.yaml (在\k8s-for-docker-desktop目录下)
找到对应版本:
执行,拉取镜像
docker pull kubernetesui/dashboard:v2.5.1
执行:
cd E:\workspace\github\AliyunContainerService\k8s-for-docker-desktop
kubectl create -f kubernetes-dashboard.yaml
开启API Server服务
kubectl proxy
cd E:\workspace\github\AliyunContainerService\k8s-for-docker-desktop
kubectl -n kubernetes-dashboard get secret
kubectl apply -f kube-system-default.yaml
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
kubectl config set-credentials docker-desktop --token="${TOKEN}"
echo $TOKEN
访问网址:登录界面
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
填入令牌:
记得点击浏览器记住该token, 免得下次登录时忘记token了
登录成功:
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
然后执行
kubectl apply -f dash.yaml
再执行
kubectl -n kubernetes-dashboard create token admin-user
获得令牌
执行
kubectl proxy
访问网站,输入令牌,成功访问
访问URL: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy
/
如果电脑或dokcerhub有重启的话,
只需要执行 kubectl proxy, 即可
在Windows上安装Docker与k8s,完美亲测!
https://blog.csdn.net/qq_15378385/article/details/130813878
(348条消息) Win10下Docker Desktop+k8s安装_win10部署k8s_尒傑的博客-CSDN博客
Windows10上Docker和Kubernetes的安装https://blog.csdn.net/weixin_42369904/article/details/124686368
win10 下 Docker启动问题docker is starting…
https://blog.csdn.net/weixin_42727710/article/details/129408406
windows下docker长期不用无法启动问题
https://blog.csdn.net/Magic_Engine/article/details/125197167