How do I get logs from all pods of a Kubernetes replication controller?

前端 未结 14 1358
不思量自难忘°
不思量自难忘° 2021-01-29 23:14

Running kubectl logs shows me the stderr/stdout of one Kubernetes container.

How can I get the aggregated stderr/stdout of a set of pods, preferably those

14条回答
  •  旧时难觅i
    2021-01-29 23:40

    You can also do this by service name.

    First, try to find the service name of the respective pod which corresponds to multiple pods of the same service. kubectl get svc.

    Next, run the following command to display logs from each container.

    kubectl logs -f service/
    

提交回复
热议问题