[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Support for Kubernetes metadata when using docker --log-driver=journald?

On 05/20/2016 10:39 AM, Clayton Coleman wrote:
Actually, there may be an issue for this already.

I created a new issue: https://github.com/kubernetes/kubernetes/issues/25975

On Fri, May 20, 2016 at 12:38 PM, Clayton Coleman <ccoleman redhat com> wrote:
We could support setting that on the Kubelet when we launch the
containers.  I think it's reasonable - if you open a Kube issue Derek
and I can chime in.

On Fri, May 20, 2016 at 12:12 PM, Rich Megginson <rmeggins redhat com> wrote:
When using OpenShift with the standard docker log driver, there are
container logs in the following format:


The fluentd log collector uses $name_of_pod and $name_of_project to look up
in k8s additional metadata for the pod and project (such as the uuids).

When using docker daemon --log-driver=journald, these files no longer exist,
and the journal entries are missing $name_of_pod and $name_of_project in the

_CMDLINE=/usr/bin/docker-current daemon
--authorization-plugin=rhel-push-plugin --selinux-enabled

When running containers via docker directly, you can use -e and -l to pass
additional metadata through to the journal output:
   docker run -e FOOT=BALL -l LA=SF --rm --name toasted \
       --log-driver=journald --log-opt env=FOOT --log-opt labels=LA \
       fedora /bin/pwd



Is there some way to make k8s and/or OpenShift add fields like
K8S_POD_NAME=$name_of_pod and
K8S_NAMESPACE_NAME=$name_of_project to the journal entries?
This will also be needed by
https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter which
assumes the entries are tagged in a similar format to the filename above.
Of course if k8s/openshift can be configured to automatically add that
additional metadata to the journal entries then the fluentd k8s metadata
plugin might not be needed.

dev mailing list
dev lists openshift redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]