📝操作记录
1、确定需要的版本eg1.18
releases下载地址 :https://github.com/kubernetes/minikube/releases?page=2
将minikube下载到本地

2、将minikube移动到对应位置&&添加可执行权限
mv ~/Downloads/minikube-darwin-amd64 /usr/local/bin/minikube
sudo chmod 555 /usr/local/bin/minikube

3、启动k8s集群,stop&delete以前的版本(如果存在)
minikube stop
minikube delete
minikube start (请翻墙,花钱能解决的问题就不要和自己过不去,人生苦短)

-> % minikube start
😄  Darwin 11.6 上的 minikube v1.18.1
✨  自动选择 hyperkit 驱动。其他选项:parallels, virtualbox, ssh
💿  正在下载 VM boot image...
    > minikube-v1.18.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
    > minikube-v1.18.0.iso: 212.99 MiB / 212.99 MiB [] 100.00% 6.23 MiB p/s 34s
👍  Starting control plane node minikube in cluster minikube
💾  Downloading Kubernetes v1.20.2 preload ...
    > preloaded-images-k8s-v9-v1....: 491.22 MiB / 491.22 MiB  100.00% 5.75 MiB
🔥  Creating hyperkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳  正在 Docker 20.10.3 中准备 Kubernetes v1.20.2…
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v4
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

4、查看Pod情况
kubectl get po -A

-> % kubectl get po -A

NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE
kube-system   coredns-74ff55c5b-x5xjs            1/1     Running   0          2m33s
kube-system   etcd-minikube                      1/1     Running   0          2m41s
kube-system   kube-apiserver-minikube            1/1     Running   0          2m41s
kube-system   kube-controller-manager-minikube   1/1     Running   0          2m41s
kube-system   kube-proxy-n6k9w                   1/1     Running   0          2m33s
kube-system   kube-scheduler-minikube            1/1     Running   0          2m41s
kube-system   storage-provisioner                1/1     Running   0          2m47s

5、打开下dashboard
minikube dashboard

-> % minikube dashboard

🔌  正在开启 dashboard ...
    ▪ Using image kubernetesui/dashboard:v2.1.0
    ▪ Using image kubernetesui/metrics-scraper:v1.0.4
🤔  正在验证 dashboard 运行情况 ...
🚀  Launching proxy ...
🤔  正在验证 proxy 运行状况 ...
🎉  Opening http://127.0.0.1:57549/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

参考文档:https://minikube.sigs.k8s.io/docs/start/

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐