How do I increase the log level for the Openshift SDN pods?

Solution Verified - Updated

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-node so that it contains a DEBUG_LOGLEVEL variable with desired value. For example, to set it to 6, the line would look like

    DEBUG_LOGLEVEL=6
    
  • Edit /etc/sysconfig/atomic-openshift-node so that it contains a DEBUG_LOGLEVEL variable with desired value. For example, to set it to 6, the line would look like

    DEBUG_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}

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.

SBR
Components
Category

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.