在M1Mac上本地运行Kubernetes
我想看看目前是否可以在 2020 M1 MacBook air 上本地运行 Kubernetes。
我需要的环境比较简单,只是为了看一些教程。举个例子,这个操作符-sdk 指南。
到目前为止,我已经尝试过microk8s和minikube,因为它们是我之前在其他机器上使用过的工具。
对于这两个,我brew在打开终端应用程序“with Rosetta 2”(即像这样)后安装了它们。我的进度是:
Minikube
当我运行时minikube start --driver=docker(已经安装了Docker Desktop for M1的技术预览版),出现初始化错误。在我看来,这里正在跟踪https://github.com/kubernetes/minikube/issues/9224。
Microk8s
microk8s install要求安装multipass,然后出现错误An error occurred with the instance when trying to start with 'multipass': returned exit code 2. Ensure that 'multipass' is setup correctly and try again.。Multipass 显示microk8s-vm卡在启动中。我认为这可能与这个问题有关https://github.com/canonical/multipass/issues/1857。
我知道我可能会更好地追查这些问题以寻求有关这些特定错误的帮助。如果目前可以/建议设置基本的 Kubernetes 环境以在 M1 mac 上使用,那么任何一般性建议都会很棒。我对这里的底层技术没有经验,因此欢迎提供任何其他上下文。:)
如果有人对实践 Kubernetes 有建议,可以替代设置本地集群,我也会很感激。谢谢!
回答
首先,在处理容器时使用 Docker 通常是好的。Docker 现在为基于 Apple M1 的 Mac 提供了 Docker的技术预览版。
当你有一个干活泊坞你的机器上,也应该努力用一种-一种对Docker容器运行Kubernetes。
- @KarthikaiselvanR - yes, I was able to create a cluster using the image linked above ( `kind create cluster --image rossgeorgiev/kind-node-arm64:v1.20.0`) with the Docker Tech Preview running. I've used that cluster for the operator-sdk tutorial I mentioned in the question, plus some examples from the kubernetes.io docs. Nothing heavy-duty, but has been absolutely fine for me for those.