在M1 Mac上本地运行Kubernetes [英] Running Kubernetes locally on M1 Mac

查看:1121
本文介绍了在M1 Mac上本地运行Kubernetes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看当前是否有可能在2020年M1 MacBook Air上本地运行Kubernetes.

I'm looking to see if it's currently possible to run Kubernetes locally on a 2020 M1 MacBook air.

我需要的环境相对简单,仅用于阅读一些教程.例如,此 operator-sdk指南.

The environment I need is relatively simple, just for going through some tutorials. As an example, this operator-sdk guide.

到目前为止,我已经尝试过 microk8s minikube ,因为它们是我之前在其他计算机上使用过的工具.

So far I've tried microk8s and minikube, as they're tools I've used before on other machines.

对于这两种方式,我在打开带有"Rosetta 2"的终端应用程序后,使用 brew 安装了它们.(即).我的进度是:

For both of these, I've installed them using brew after opening the terminal app "with Rosetta 2" (i.e like this). My progress is then:

Minikube

当我运行 minikube start --driver = docker 时(已安装 https://github.com/kubernetes/minikube/issues/9224 .

When I run minikube start --driver=docker (having installed the tech preview of Docker Desktop for M1), an initialization error occurs. It seems to me that this is being tracked here https://github.com/kubernetes/minikube/issues/9224.

Microk8s

microk8s install 要求安装 multipass ,然后出现错误,尝试以"multipass"启动时实例发生错误:返回退出代码2.确保正确设置了"multipass",然后重试..Multipass显示 microk8s-vm 处于启动状态.我认为这可能与此问题有关 https://github.com/canonical/multipass/issues/1857.

microk8s install asks to install multipass, which then errors with 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 shows a microk8s-vm stuck in starting. I think this may relate to this issue https://github.com/canonical/multipass/issues/1857.

我知道我可能最好追逐这些问题以寻求有关这些特定错误的帮助.最好的是就目前是否可以/建议设置一个基本的Kubernetes env以在M1 mac上玩游戏提供任何一般建议.我对这里的基础技术没有经验,因此欢迎任何其他上下文.:)

I'm aware I'd probably be better chasing up those issues for help on these particular errors. What would be great is any general advice on if it's currently possible/advisable to setup a basic Kubernetes env for playing with on an M1 mac. I'm not experienced with the underlying technologies here, so any additional context is welcome. :)

如果有人对实践Kubernetes有建议,而不是建立本地集群,我也将不胜感激.谢谢!

If anyone has suggestions for practising Kubernetes, alternative to setting up a local cluster, I'd also appreciate them. Thanks!

推荐答案

首先,在使用容器时通常最好安装Docker.Docker现在具有适用于基于Apple M1的Mac的Docker技术预览.

First, it is usually good to have Docker when working with containers. Docker now has a Tech Preview of Docker for Apple M1 based macs.

当您在计算机上使用Docker时,也可以使用亲切的-a在Docker容器上运行Kubernetes的方法.

When you have a workin Docker on your machine, it should also work to use Kind - a way to run Kubernetes on Docker containers.

这篇关于在M1 Mac上本地运行Kubernetes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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