kubectl logs

输出pod中一个容器的日志。如果pod只包含一个容器则可以省略容器名。



kubectl logs [-f] [-p] POD [-c CONTAINER]


返回仅包含一个容器的pod nginx的日志快照


$ kubectl logs nginx



返回pod ruby中已经停止的容器web-1的日志快照


$ kubectl logs -p -c ruby web-1



持续输出pod ruby中的容器web-1的日志


$ kubectl logs -f -c ruby web-1



仅输出pod nginx中最近的20条日志


$ kubectl logs –tail=20 nginx



输出pod nginx中最近一小时内产生的所有日志


$ kubectl logs –since=1h nginx



https://www.kubernetes.org.cn/doc-64


Category k8s
Error: Comments Not Initialized

泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353
泽民博客
zemin
2025-04-04 03:54:28.353