macbook pro m4搭建简易kubernetes

257 阅读1分钟

1 brew命令安装

# 外网镜像源 报错 /bin/bash -c "$(curl -fsSL raw.githubusercontent.com/Homebrew/in…)

"curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 18 ms: Couldn't connect to server

# 采用国内镜像

/bin/zsh -c "$(curl -fsSL gitee.com/cunkai/Home…

按照提示选择国内源 gitee和阿里云镜像,最后重启终端,或者根据提示source .zprofile让brew指令生效。

2 安装minikube

brew install minikube

3 启动minikube

minikube start

但是启动过程中出现错误,以来的相关组件未部署

Darwin 15.3.1 (arm64) 上的 minikube v1.35.0��  无法选择默认驱动程序。以下是按优先顺序考虑的内容:��  或者你也可以安装以下驱动程序:    ▪ docker: Not installed: exec: "docker": executable file not found in PATH   ▪hyperkit:Notinstalled:exec:"hyperkit":executablefilenotfoundinPATH    ▪ hyperkit: Not installed: exec: "hyperkit": executable file not found in PATH    ▪ parallels: Not installed: exec: "prlctl": executable file not found in PATH   ▪qemu2:Notinstalled:exec:"qemusystemaarch64":executablefilenotfoundinPATH    ▪ qemu2: Not installed: exec: "qemu-system-aarch64": executable file not found in PATH    ▪ virtualbox: Not installed: unable to find VBoxManage in PATH   ▪podman:Notinstalled:exec:"podman":executablefilenotfoundinPATH    ▪ podman: Not installed: exec: "podman": executable file not found in PATH    ▪ vfkit: Not installed: exec: "vfkit": executable file not found in $PATH ❌  因 DRV_NOT_DETECTED 错误而退出:未检测到可用的驱动程序。尝试指定 --driver,或查看 minikube.sigs.k8s.io/docs/start/…

下面依次部署相关组件

| # docker 提供镜像、容器、仓库三大利器,让微服务和组件可以运行 安装docker-cli

brew install

安装dockerdocs.docker.com/desktop/rel…选择mac with apple chip进行安装docker desktop,下载完成启动,选择默认配置即可。此时docker就启动了。  记得别忘了在docker engine中添加国内镜像源

 

截屏2025-03-13 10.41.46.png

因为我的修改所以minikube更改为使用podman,我这边将minikube修改,即

minikube stop minikube delete 

再次尝试启动minikube start

 

截屏2025-03-13 11.12.16.png

4 验证启动命令

minikube statusminikubetype: Control Planehost: Runningkubelet: Runningapiserver: Runningkubeconfig: Configured minikube node listminikube 192.168.58.2 

5 启动面板

minikube dashboard

截屏2025-03-13 11.16.35.png