How do I increase the log level for the Openshift SDN pods?
Environment
- Openshift Container Platform
- 3.10
- 3.11
Issue
How do I increase the DEBUG_LOGLEVEL parameter to debug SDN pods in Openshift 3.10+?
Resolution
-
SSH to the node and become root
-
Edit or create
/etc/sysconfig/origin-nodeso that it contains aDEBUG_LOGLEVELvariable with desired value. For example, to set it to6, the line would look likeDEBUG_LOGLEVEL=6 -
Edit
/etc/sysconfig/atomic-openshift-nodeso that it contains aDEBUG_LOGLEVELvariable with desired value. For example, to set it to6, the line would look likeDEBUG_LOGLEVEL=6 -
From a master as root (replace
${NODE_NAME}) with the name of the node- Drain the node:
oc adm drain --ignore-daemonsets --delete-local-data ${NODE_NAME} - Check the SDN pod:
oc -n openshift-sdn get pod -o wide --field-selector=spec.nodeName=${NODE_NAME} -l app=sdn - Delete the SDN pod:
oc -n openshift-sdn delete pod --field-selector=spec.nodeName=${NODE_NAME} -l app=sdn - Wait until the new pod is running
- Uncordon the node:
oc adm uncordon ${NODE_NAME}
- Drain the node:
Root Cause
SDN is a separate component that runs inside a pod, so it is necessary to set the log level on the configuration files mentioned in the resolution and restart the pod as indicated.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.