kube-rbac-proxy
kube-rbac-proxy copied to clipboard
Option to output the logs as JSON
For the automatic collection of logs using a service such as Filebeat, it would be helpful if the logs could be output as JSON, e.g. by using a flag. For example, you could use the JSON logging format from the Kubernetes Community Repository.
{"ts": 1580306777.04728,"v": 4,"msg": "Pod status was updated","pod":{"name": "kube-dns","namespace": "kube-system"},"status": "ready"}
The concrete use case is that the RBAC proxy runs in a pod together with a controller manager for a custom operator (created with kubebuilder). The controller manager created with kubebuilder uses the zap logging library and it can be configured to use JSON as logging format. It would be nice if the rbac proxy would also log using JSON logging, so that both containers in the pod use the same logging format. This would allow Filebeat to easily collect the logs from both containers in the pod.
Hi,
I've seen this issue long time ago, but never came back to it. Sorry for the delay. I will try to take a look next month.
This is a thing that we most probably will make happen at some point 😅
Would be a great feature!