如何在Windows 10 Pro上同时运行Kubernetes和Docker? [英] How to run Kubernetes and Docker at the same time on Windows 10 Pro?

查看:128
本文介绍了如何在Windows 10 Pro上同时运行Kubernetes和Docker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的本地Kubernetes云中运行Docker实例.

I would like to run Docker instances in my local Kubernetes cloud.

我在Windows 10 Pro上激活了Hyper-V以适应Docker. Docker运行良好,我可以完美地使用CLI.

I activated Hyper-V on my Windows 10 Pro to accommodate for Docker. Docker runs fine, I can use the CLI perfectly.

现在我正在尝试运行Kubernetes/Minikube.不幸的是,如果我激活了Hyper-V,Minikube会给我一个错误.

Now I'm trying to run Kubernetes / Minikube. Unfortunately, Minikube gives me an error if I have Hyper-V activated.

如果我停用Hyper-V并重新启动,则Docker表示如果没有Hyper-V,它将无法运行.这似乎是一个难题.

If I deactivate Hyper-V and reboot, Docker says that it cannot run without Hyper-V. That seems like a conundrum.

是否有同时运行的提示或建议?我想在本地Kubernetes集群中旋转Docker映像.

Any tips or suggestions to have both running? I'd like to spin docker images in my local Kubernetes cluster.

谢谢!

推荐答案

似乎您对虚拟机监控程序的使用存在问题.我已经在我下面要链接的最新答案之一中解释了有关相互使用Docker和Kubernetes的详细信息.

Seems like you have a problem with the hypervisor usage. I've explained details about using Docker and Kubernetes with each other in one of my recent answers which I will link below.

  • 您不能在Docker和minikube中同时使用Kubernetes(或者如果您使用上下文,也许可以使用,但我尚未对其进行测试,为简单起见,您不能使用).如果将Docker用于k8s集群,则将使用kubectl与集群进行交互,因此无需使用minikube.只需转到Kubernetes->在Docker应用中启用Kubernetes,然后根据Docker文档 此处在Kubernetes部分:

如果要在Windows和minikube上使用Docker,则必须 在运行minikube start时指定参数.就你而言 需要使用标准的方式来运行Windows的minikube.你可以 例如,请参阅此指南.准备好设置后 您可以使用minikube start --vm-driver hyperv --hyperv-virtual-switch "vSwitch name" 启动它.请注意,Hyper-V应该是唯一活动的虚拟机监控程序.,您可以继续使用Docker 做到了.

If you want to use Docker for Windows and minikube, you have to specify the arguments when you run minikube start. In your case you need to use standard way of running minikube for Windows. You can follow this guide for example. When you are ready with the setup you start it with minikube start --vm-driver hyperv --hyperv-virtual-switch "vSwitch name" Note that Hyper-V should be the only hypervisor active. and you can keep using Docker as you did.

因此,这里的重要部分是确定要使用的工具. 另一重要的事情是,您现在可能会陷入错误,并且它们可能与minikube的剩余部分有关.因此,在继续操作之前,请记住将Docker恢复为出厂默认值,并在遇到错误时删除.minikube和.kube.

So the important part here is to decide which tools exactly you want to use. One more important thing, you might get stuck with errors now, and they might be connected to leftovers of minikube. So before you go further remember to revert Docker to factory defaults and delete .minikube and .kube if you meet errors.

这篇关于如何在Windows 10 Pro上同时运行Kubernetes和Docker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆