Huawei / eSDK_K8S_Plugin

Container-Storage-Interface (CSI) for Huawei storage
Apache License 2.0
82 stars 47 forks source link

Provide option to log to stdout #26

Closed tongpu closed 1 year ago

tongpu commented 3 years ago

The way the logging stack for huawei-csi is currently set up all logs are written to /var/log/huawei and no information is visible when using kubectl logs.

This additionally also leads to the issue that when running on OpenShift the controller needs to be run with a privileged security context, because it needs to run as root:root to be able to log to /var/log/huawei.

juliohm1978 commented 3 years ago

Since we still need to build the Docker image ourselves, we managed to redirect logs to stdout by just linking log files to /dev/stdout. In your Dockerfile:

RUN mkdir -p /var/log/huawei \
 && ln -s /dev/stdout /var/log/huawei/huawei-csi-controller \
 && ln -s /dev/stdout /var/log/huawei/huawei-csi-node

And in your manifests do deploy, comment out every occurrance of /var/log mounts.

image

pbabilas commented 2 years ago

all you need to do is set param - "--loggingModule=console" in args of huawei-csi-driver ;]