kuberay icon indicating copy to clipboard operation
kuberay copied to clipboard

[Feature] Enable controller and apiserver to write logs to file path

Open Jeffwan opened this issue 3 years ago • 5 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Description

Currently, we use stdout to catch control plane logs. This is inconvenient under some cases. Alternatively, we want to dump logs to a file path and use log shipper to send to remote logging system like ELK etc. So the ideal way is we both write logs to stdout and file.

Use case

As a user, I want to ship my logs to the logging system.

Related issues

No response

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

Jeffwan avatar Sep 27 '22 18:09 Jeffwan

/cc @Basasuya

Jeffwan avatar Sep 27 '22 18:09 Jeffwan

This seems reasonable -- writing to disk could be enabled by an option in the operator entrypoint.

DmitriGekhtman avatar Sep 28 '22 02:09 DmitriGekhtman

My preliminary conclusion is that using klog to write to file and stdout. I will research on the writing file feature of klog

Basasuya avatar Sep 28 '22 15:09 Basasuya

sgtm Let's just make sure not to alter the default behavior. (So by default, don't write to disk.)

DmitriGekhtman avatar Sep 28 '22 15:09 DmitriGekhtman

After testing, I found Dockerfile is using gcr.io/distroless/static:nonroot as based image, which can not exec into the container. Writing to file is meaningless because I can not see them. So should we use swap the based image?

\cc @Jeffwan @DmitriGekhtman

Basasuya avatar Oct 09 '22 11:10 Basasuya

This issue is resolved by #632. Close it.

kevin85421 avatar Dec 09 '22 18:12 kevin85421