Temporary "openshift-debug-node" namespaces do not get deleted properly after "oc debug node" in Openshift Container Platform 4.

Solution Verified - Updated

Environment

  • Red Hat Openshift Container Platform (RHOCP)
    • 4

Issue

  • After issuing an oc debug node/<nodename>, the created namespaces are not getting deleted properly and automatically.

Resolution

  • Automatic deletion was fixed in Openshift Container platform 4.6.28+ and Openshift Container platform 4.7.8+

  • The namespaces can be deleted manually:

    $ oc delete namespace <debug-namespace>
    
  • Multiple namespaces can be deleted at once manually:

    • To get the list of all debug namespaces in cluster:
    $ oc get $(oc get -o name namespaces | grep 'namespace/openshift-\(debug\)')
    
    • To delete all the debug namespaces in cluster:
    $ oc delete $(oc get -o name namespaces | grep 'namespace/openshift-\(debug\)')
    

Root Cause

Disclaimer: Links contained herein to external website(s) are provided for convenience only. Red Hat has not reviewed the links and is not responsible for the content or its availability. The inclusion of any link to an external website does not imply endorsement by Red Hat of the website or its entities, products, or services. You agree that Red Hat is not responsible or liable for any loss or expenses that may result due to your use of (or reliance on) the external site or content.

The creation of additional namespace for debugging was coming from solving another This content is not included.BZ#1812813. After that, it was decided to revert that change, and that happened in the Content from github.com is not included.Pull Request#668.

Diagnostic Steps

Actual results:

# oc get ns | grep -i debug
openshift-debug-node-7k4p88q4kk                    Active        78d
openshift-debug-node-7shqwcjgwf                    Active        57d
openshift-debug-node-c5zp2njj2c                    Active        48d
openshift-debug-node-fr768h6jw2                    Active        48d
openshift-debug-node-gxtb2                         Active        21d
openshift-debug-node-hz2z7r9vrs                    Active        26h
openshift-debug-node-pdlxr86vtp                    Active        57d
openshift-debug-node-t4vp6cgxzl                    Active        62d
openshift-debug-node-z2n2s6gmvq                    Active        86d
openshift-debug-node-zjlvczvwfd                    Active        48d
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.