With docker, the below daemon.json for journald:
{
"log-driver": "journald",
"log-opts": {
"tag":"{{.ID}}",
"labels": "io.kubernetes.container.name,io.kubernetes.pod.name"
}
}
We can filter journalctl logs by IO_KUBERNETES_CONTAINER_NAME=<container-name>. Where container-name is the one defined in the k8s manifest.
...
containers:
- args:
...
name: kafka
In crio, when logging to journald, the CONTAINER_NAME filter outputs the pod name instead along with some hash:
k8s_kafka_kafka-0_default_4067521d-941e-460a-b8c0-8ec98ecb9dd0_0
Is there a way to configure the fields we send to journald like docker does? So that we can have only kafka returned when doing the filter match?
With docker, the below
daemon.jsonforjournald:We can filter journalctl logs by
IO_KUBERNETES_CONTAINER_NAME=<container-name>. Wherecontainer-nameis the one defined in the k8s manifest.In crio, when logging to journald, the
CONTAINER_NAMEfilter outputs the pod name instead along with some hash:Is there a way to configure the fields we send to journald like docker does? So that we can have only
kafkareturned when doing the filter match?