如何从 Kubernetes 复制控制器的所有 pod 获取日志? [英] How do I get logs from all pods of a Kubernetes replication controller?
本文介绍了如何从 Kubernetes 复制控制器的所有 pod 获取日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行 kubectl logs
向我展示了一个 Kubernetes 容器的 stderr/stdout.
Running kubectl logs
shows me the stderr/stdout of one Kubernetes container.
如何获取一组 Pod 的聚合 stderr/stdout,最好是由某个复制控制器创建的那些?
How can I get the aggregated stderr/stdout of a set of pods, preferably those created by a certain replication controller?
推荐答案
可以使用标签
kubectl logs -l app=elasticsearch
这篇关于如何从 Kubernetes 复制控制器的所有 pod 获取日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文