minikube---kubectl常用命令
-
创建service与pods类似不再重复
- 创建Pods
kubectl create -f development.yaml
kubectl run nginx --image=nginx --port=8080
- 删除Pods(切记namespace这个坑)
kubectl delete deploy/nginx -n test
kubectl delete -f development
- 更新Pods
kubectl replace -f development
kubectl replace --force -f development
强制更新 - Pods日志
kubectl logs $pods_name -n test
(-n代表namespace) - Pods exec
kubectl exec $pods_name -it -n test -- /bin/sh
-pods/service describekubectl describe pod/$pods_name -n test
kubectl describe deploy/$deploy_name -n test
kubectl describe service/$service_name -n test
- 创建Pods