kubectl logs
Show logs for containers in a pod. More information: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/.
- Show logs for a single-container pod:
kubectl logs
- Show logs for a specified container in a pod:
kubectl logs
- Show logs for all containers in a pod:
kubectl logs --all-containers=
- Stream pod logs:
kubectl logs
- Show pod logs newer than a relative time like
10s,5m, or1h:
kubectl logs --since
- Show the 10 most recent logs in a pod:
kubectl logs --tail 10
- Show all pod logs for a given deployment:
kubectl logs /
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
