1.安装kubectl命令#
1 | brew install kubectl |
如果想安装指定版本的kubectl
1 | curl -LO "https://dl.k8s.io/release/v1.20.0/bin/darwin/amd64/kubectl" |
验证版本,会打印出client端和server端的版本,官方建议2个版本直接版本相差不要大于+/-1
1 | kubectl version |
2.下载和安装minikube#
1 | ➜ /Users/lintong/Downloads $ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 |
参考
1 | https://minikube.sigs.k8s.io/docs/start/ |
如果要安装指定版本的话,请到下面的地址下载
1 | https://github.com/kubernetes/minikube/releases |
比如安装v1.21.0版本
1 | curl -LO https://github.com/kubernetes/minikube/releases/download/v1.21.0/minikube-darwin-amd64 |
卸载minikube
1 | minikube delete |
3.安装virtualbox#
1 | brew install virtualbox |
4.使用virtualbox来启动minikube集群#
参考:在Mac上基于virtualbox安装minikube
1 | minikube start --memory=4096 --driver=virtualbox |
如果报 Vagrant up failing for VirtualBox provider with E_ACCESSDENIED on host-only network,则添加 /etc/vbox/networks.conf 文件,如下
1 | 192.0.0.0/8 |
且保证在mac的 System Preferences -> Security & Privacy -> Allow -> Then allow the software corporation (in this case Oracle)
5.使用请参考:ubuntu16.04安装minikube