weaveworks / scope

Monitoring, visualisation & management for Docker & Kubernetes
https://www.weave.works/oss/scope/
Apache License 2.0
5.86k stars 714 forks source link

show pod logs for multi-container pods #2234

Closed rade closed 6 years ago

rade commented 7 years ago

Right now a user can only view the logs of containers, not of whole pods. We have a hack in place so that when a pod only has one non-pause container then in the details panel of the pod, we let the user view the logs of that container. This doesn't work for the likes of Weave Net pods, which comprise several containers.

Essentially we want the equivalent of kubectl logs -f <pod>.

rade commented 7 years ago

Right now a user can only view the logs of containers, not of whole pods. We have a hack in place so that when a pod only has one non-pause container then in the details panel of the pod, we let the user view the logs of that container.

I completely misinterpreted what I was seeing...

The 'Get logs' button on the pod detail panel does fetch the pod logs using the k8s API. It even shows history.

HOWEVER, it appears that said k8s API requires a container to be specified when the pod contains more than one (plus plause). Otherwise a "a container name must be specified for pod blah, choose one of: [blah, blah]" error is returned.

ekimekim commented 7 years ago

What are you suggesting design-wise? Interleaving the logs in the output window? Should we add a prefix saying where they're from? eg.

[container_a] foo
[container_a] bar
[container_b] foo
[container_a] baz
[container_b] bar
rade commented 7 years ago

see also #1493.

rade commented 6 years ago

@awh has just found https://github.com/wercker/stern - perhaps we could embed that?

It can also provide combined logs across replicas, so we could get logs at the controller level!

rade commented 6 years ago

This got resolved by #3013