创建Kubernetes cluster(单机版)最简单的方法是minikube
GitHub 地址: https://github.com/kubernetes/minikube文章源自十年又十年-https://www.bbigsun.com/841.html
文档: https://minikube.sigs.k8s.io/docs/start/文章源自十年又十年-https://www.bbigsun.com/841.html
安装
Linux_x86-64_Stable_Binary Dowbload
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
Linux_x86-64_Stable_Debian package
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
Linux_x86-64_Stable_RPM package
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
sudo rpm -Uvh minikube-latest.x86_64.rpm
启动集群
minikube start
与集群交互
kubectl get po -A
minikube kubectl -- get po -A
alias kubectl="minikube kubectl --"
minikube dashboard
部署应用
Service
创建一个简单 Deployment 资源并暴露8080端口:文章源自十年又十年-https://www.bbigsun.com/841.html
kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0
kubectl expose deployment hello-minikube --type=NodePort --port=8080
kubectl get services hello-minikube
管理集群
minikube pause
minikube unpause
minikube stop
minikube config set memory 9001
minikube addons list
minikube start -p aged --kubernetes-version=v1.16.1
minikube delete --all
文章源自十年又十年-https://www.bbigsun.com/841.html文章源自十年又十年-https://www.bbigsun.com/841.html 纸上得来终觉浅,绝知此事要躬行。
17688689121
我的微信
微信扫一扫
评论