Easier method for getting container logs in sidecar charms

Bug #1931759 reported by Tom Haddon
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Confirmed
Undecided
Unassigned

Bug Description

Currently if you're troubleshooting problems with a sidecar charm very often you need to look at the workload container logs. It's great that pebble now includes the workload output there, but the method for retrieving this is currently quite cumbersome. Assuming I have a model name of `concourse-test` and an application name of `concourse-worker` and a workload container name of `concourse-worker` the command (in MicroK8s) is:

microk8s.kubectl logs -n concourse-test concourse-worker-0 -c concourse-worker

It would be much easier if there was a juju native way of doing this. Something like this maybe?:

juju container-logs concourse-worker/0

I guess the obvious issue with this is which container this gets the logs for. Possibly we could default to getting them all but allow filtering?

juju container-logs -c concourse-worker concourse-worker/0

Tom Haddon (mthaddon)
tags: added: sidecar-charm
Revision history for this message
James Page (james-page) wrote :

Seems like a nice addition to the set of abstractions that Juju is providing over K8S +1 from me.

Revision history for this message
Ben Hoyt (benhoyt) wrote :

Note that this isn't possible with IAAS models either, but it seems like a useful feature (I always have to look up the exact `kubectl` CLI incantation too). Would "juju container-logs" apply to pod-spec charms too?

Changed in juju:
status: New → Confirmed
Revision history for this message
Tom Haddon (mthaddon) wrote :

The difference with machines is you can just ssh into the machine and inspect the logs. You can't do that in k8s because the logs are send to stdout. And juju debug-log doesn't include logs from sidecar containers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.