-
Story
-
Resolution: Unresolved
-
Medium
-
None
-
None
Sometimes we need to set DEBUG level in SDNC (in karaf) for troubleshooting.
Here is the way how to do it:
opendaylight-user@root>log:set INFO ROOT opendaylight-user@root>log:display
This command modify this file in real-time in SDNC POD:
/opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
At the same time, as it's mounted from configmap, Kubernetes doesn't allow to modify it. Here is a K8S change reference Link: https://github.com/kubernetes/kubernetes/issues/62099
Due to that, setting loglevel in Karaf is not possible:
opendaylight-user@root>log:set DEBUG ROOT Error executing command: Configuration org.ops4j.pax.logging is read-only opendaylight-user@root>log:display Error executing command: Configuration org.ops4j.pax.logging is read-only
Readonly mount of configmaps can be overrided, but will affect whole cluster, which is not good.
My proposal for SDNC log config file is :
- mount configmap as read-only to /tmp/ directory
- copy org.ops4j.pax.logging.cfg to target destination in Pod lifecycle hook postStart, which is already used by SDNC
Here is example:
- mountPath: /tmp/org.ops4j.pax.logging.cfg name: sdnc-logging-cfg-config subPath: org.ops4j.pax.logging.cfg
lifecycle: postStart: exec: command: - sh - -c - | ln -s /var/custom-certs/secret-0/* /var/custom-certs; cp /tmp/org.ops4j.pax.logging.cfg /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg;
- is duplicated by
-
OOM-2426 update sdnc logging configuration
- Delivered