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

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

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 metadata:

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

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.

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