- 检测是否支持虚拟化,有输出说明支持
sysctl -a | grep machdep.cpu.features
- 安装 docker
brew cask install docker
- 安装 VirtualBox
brew cask install virtualbox
- 安装 kubectl
brew install kubernetes-cli
- 安装 Minikube
brew cask install minikube
- 创建集群,会下载一些镜像,需要科学上网配置命令行终端代理
minikube start
😄 minikube v1.1.0 on darwin (amd64)
🔥 Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
🐳 Configuring environment for Kubernetes v1.14.2 on Docker 18.09.6
🚜 Pulling images ...
🚀 Launching Kubernetes ...
⌛ Verifying: apiserver proxy etcd scheduler controller dns
🏄 Done! kubectl is now configured to use "minikube"
- 使用 kubectl 查看集群是否正常工作
kubectl cluster-info
Kubernetes master is running at https://192.168.99.105:8443
KubeDNS is running at https://192.168.99.105:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
- 登录到 Minikube VM 内部
minikube ssh
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$
- 浏览器中打开控制台
minikube dashboard
image.png
官方文档
安装 Minikube
网友评论