MacOS 搭建Minikube体验K8S

#安装
brew install minkube

#如果已安装则停止
minikube stop

#(如果已安装则删除)
minikube delete

#启动
minikube start --kubernetes-version=v1.23.8 --image-mirror-country='cn' --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers' 

#启动 Kubernetes 仪表板
minikube dashboard


#测试

#创建部署
kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0

#暴露端口
kubectl expose deployment hello-minikube --type=NodePort --port=8080

#查看service
kubectl get services hello-minikube

#让minikube为您启动Web浏览器
minikube service hello-minikube

#或者使用 kubectl 转发端口
kubectl port-forward service/hello-minikube 7080:8080


#清理
kubectl delete service hello-minikube
kubectl delete deployment hello-minikube

你可能感兴趣的:(MacOS 搭建Minikube体验K8S)