尽管作为 VM 运行,Minikube Kubernetes 不允许在 Mac 上进入

Sti*_*cky 11 docker kubernetes minikube kubernetes-ingress

我跑了minikube start --vm=true哪个输出:

  minikube v1.12.2 on Darwin 10.15.5
?  Using the docker driver based on existing profile
?  Your system has 16384MB memory but Docker has only 1991MB. For a better performance increase to at least 3GB.

    Docker for Desktop  > Settings > Resources > Memory


  Starting control plane node minikube in cluster minikube
  Restarting existing docker container for "minikube" ...
  Preparing Kubernetes v1.18.3 on Docker 19.03.8 ...
  Verifying Kubernetes components...
  Enabled addons: dashboard, default-storageclass, storage-provisioner
  Done! kubectl is now configured to use "minikube"
Run Code Online (Sandbox Code Playgroud)

然后这minikube addons enable ingress给了我这个错误:

  Due to docker networking limitations on darwin, ingress addon is not supported for this driver.
Alternatively to use this addon you can use a vm-based driver:

    'minikube start --vm=true'

To track the update on this work in progress feature please check:
https://github.com/kubernetes/minikube/issues/7332

Run Code Online (Sandbox Code Playgroud)

但是我用那个特定的标志运行 minikube - 有什么建议吗?

mar*_*rio 29

看起来您的Minikube没有作为 VM 运行。实际上它仍然使用Docker驱动程序。只需仔细查看输出,其中Docker提到了几次:

?  Using the docker driver based on existing profile
?  Your system has 16384MB memory but Docker has only 1991MB. For a better performance increase to at least 3GB.

    Docker for Desktop  > Settings > Resources > Memory
Run Code Online (Sandbox Code Playgroud)

关键点是“基于现有配置文件”

和这里:

  Restarting existing docker container for "minikube" ...
  Preparing Kubernetes v1.18.3 on Docker 19.03.8 ...
Run Code Online (Sandbox Code Playgroud)

尽管您尝试使用选项启动Minikube--vm=true,但它显然被忽略并使用您的默认设置。

很可能发生这种情况是因为您第一次使用--driver=docker选项(显式或隐式)运行它并且它已保存在您的Minikube配置文件中。要解决此问题,您可能需要删除Minikube实例,然后使用--vm=true选项重新启动它。您可以更加科学,并通过提供--driver=hyperkit选项来选择确切的虚拟机管理程序。

因此,只需尝试以这种方式启动您的Minikube

minikube start --vm=true --driver=hyperkit
Run Code Online (Sandbox Code Playgroud)

如果这没有帮助并且您将再次看到相同的输出,并提到它一直在使用docker驱动程序,请运行:

minikube stop && minikube delete && minikube start --vm=true --driver=hyperkit
Run Code Online (Sandbox Code Playgroud)

这应该可以解决您的问题。一旦它开始使用HyperKit管理程序,您应该能够正常运行minikube addons enable ingress而不会出现任何错误。

  • 请为 M1 macbook 添加警告,这只会删除您的 minikube,因此您必须重新开始,因为 ARM 不支持 hyperkit。 (4认同)