Pod

查看Pod:kubectl get pod -o wide
查看日志:kubectl logs -f pod/对用NAME
删除:kubectl delete pod
强制删除:kubectl delete pod 对应的NAME --force --grace-period=0 (一般node挂掉,才需要此命令)
查看详情:kubectl describe pod 对应的NAME
查看环境变量:kubectl exec 对应的NAME – env
进入Pod内部:kubectl exec -it 对应的NAME – /bin/sh
退出Pod:exit

Deployment

查看deployment:kubectl get deploy
删除deployment:kubectl delete deploy/对应的NAME
yaml创建deployment:kubectl apply -f xxx.yaml

Service

查看service:kubectl get svc -o wide
删除service:kubectl delete service/对应的NAME
yaml创建service:kubectl apply -f xxx.yaml

nodes

查看nodes情况:kubectl get nodes

Logo

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

更多推荐