1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| # 查看资源对象详细配置 kubectl get pod myapp-848b5b879b-5f69p -o yaml kubectl describe pods nginx-554b9c67f9-f2mwt
# 标签选择查看pod kubectl get pods -l app=filebeat -o wide kubectl get pods -w # 观察更新状态
## 日志查看 kubectl logs -f pod-demo kubectl logs pod-demo myapp # 查看pod中myapp容器的日志
## 进入pod中的myapp容器中 kubectl exec -it pod-demo -c myapp -- /bin/sh
# 查看资源对象配置文档 kubectl explain pod kubectl explain pod.spec
# 查看集群相关信息 kubectl get node kubectl get cs kubectl api-resources kubectl api-versions
|