我尝试在Windows Server 2019上添加一个Kubernetes工作节点。我成功地使用Ubuntu 20.04 LTS在Hyper-V虚拟机上创建了一个主节点。在Windows上,我首先安装了Docker,然后从https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/链接使用了下面的命令。
curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
.PrepareNode.ps1 -KubernetesVersion v1.23.0
尽管我成功安装了docker并启动了docker服务,但我从命令行收到了以下错误。
PrepareNode.ps1 : Docker service was not detected - please install start Docker before calling Pre
pareNode.ps1 with -ContainerRuntime Docker
At line:2 char:1
+ .PrepareNode.ps1 -KubernetesVersion v1.23.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PrepareNode.ps1
如何解决这个问题?提前谢谢你
编辑:
Docker Engine工作正常,服务启动,我可以运行容器,但当我在命令行上编写此命令时,我收到以下错误:
docker -H npipe:////./pipe/docker_engine version
产出:
Client: Docker Engine - Enterprise
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 2ee0c57608
Built: 11/13/2019 08:00:16
OS/Arch: windows/amd64
Experimental: false
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/version: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
2条答案
按热度按时间eanckbw91#
启动Docker Desktop将修复此错误,并将根据您的错误运行所需的Docker守护进程。
您可以在此处找到如何启动Docker Desktop的指南
如果启动后错误仍然存在,请尝试使用
cmd
中的以下命令切换Docker守护程序类型:but5z9lq2#
安装docker后,您应该重新启动计算机才能找到它。