1.下载minikube.
-
curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.0.1/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
2.安装VMware Fushion或Virtual Box.
略
3.启动minikube.
-
minikube start --registry-mirror=https://registry.docker-cn.com --vm-driver=vmwarefusion
# Minikube支持以下驱动程序,默认为virtualbox,none驱动程序需要Docker和Linux环境
1.virtualbox
2.vmwarefusion
3.kvm2
4.kvm
5.hyperkit
6.xhyve (deprecated)
7.hyperv
8.none
4.启动dashboard
-
minikube dashboard
# 如果没有安装kubectl命令会报错
5.在macOS上安装kubectl
- 下载kubectl
-
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/darwin/amd64/kubectl
-
- 添加可执行权限
-
chmod +x ./kubectl
-
- 添加到PATH环境变量
-
sudo mv ./kubectl /usr/local/bin/kubectl
-
6.ssh连接到节点
-
$ minikube ssh
_ _ _ _ ( ) ( ) ___ ___ (_) ___ (_)| |/') _ _ | |_ __ /' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\ | ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/ (_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____) $