k8s运维指令 kubectl 常用指令
kubectl logs-f com-job-759fb4b9bf-9f79w--previous --tail=10(获取“前一个”容器的日志(例如崩溃的情况))kubectl top pods -A | sort --reverse --key 4 --numeric(pod使用cpu情况)kubectl top pods -A | sort --reverse --key 4 --numer
kubectl top pods -A | sort --reverse --key 4 --numeric (pod使用内存情况)
kubectl top pods -A | sort --reverse --key 3 --numeric (pod使用cpu情况)
kubectl describe deployment | grep Events (deployment故障事件提示)
kubectl describe pod | grep Events (pod故障事件提示)
kubectl logs -f com-job-759fb4b9bf-9f79w --tail=100 (查看容器尾部100行日志)
kubectl logs -f com-job-759fb4b9bf-9f79w --previous --tail=10 (获取“前一个”容器的日志(例如崩溃的情况))
直接查看 容器内某个目录
kubectl exec -it controller-basic-6fd6 ls /usr/local/tomcat/webapps/ROOT/WEB-INF/lib | grep 'yqbsoft'
更多推荐
所有评论(0)