Bug 1779332 - oc debug init container on hostnetwork / hostpid DaemonSet Pod does not work
Summary: oc debug init container on hostnetwork / hostpid DaemonSet Pod does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.3.0
Assignee: Clayton Coleman
QA Contact: zhou ying
URL:
Whiteboard:
Depends On: 1779331
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-03 18:57 UTC by Clayton Coleman
Modified: 2020-01-23 11:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1779331
Environment:
Last Closed: 2020-01-23 11:17:46 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 200 0 'None' closed Bug 1779332: Fix a number of issues around debugging daemonset pods and init containers 2021-02-19 23:00:26 UTC
Red Hat Product Errata RHBA-2020:0062 0 None None None 2020-01-23 11:18:04 UTC

Description Clayton Coleman 2019-12-03 18:57:00 UTC
+++ This bug was initially created as a clone of Bug #1779331 +++

Init containers were not fully supported in oc debug.  We need to fix that, and also ensure that specific debug options work well with DaemonSet pods.

Comment 2 zhou ying 2019-12-11 13:49:05 UTC
Confirmed with the latest oc client, the issue has fixed:

[root@dhcp-140-138 ~]# oc version -oyaml
clientVersion:
  buildDate: "2019-12-06T11:24:15Z"
  compiler: gc
  gitCommit: 3fa38ed2761a75d4c648acfc8ac14df930219ed5
  gitTreeState: clean
  gitVersion: v4.3.0
  goVersion: go1.12.12
  major: ""
  minor: ""
  platform: linux/amd64


[root@dhcp-140-138 ~]# oc debug po/myapp-pod -n zhouy -c init-mydb --keep-init-containers=false
Starting pod/myapp-pod-debug, command was: sh -c until nslookup mydb; do echo waiting for mydb; sleep 2; done;
Pod IP: 10.128.2.19
If you don't see a command prompt, try pressing enter.
/ # 

[root@dhcp-140-138 ~]# oc describe po/myapp-pod-debug  -n zhouy
Name:         myapp-pod-debug
Namespace:    zhouy
Priority:     0
Node:         ip-10-0-138-96.us-east-2.compute.internal/10.0.138.96
Start Time:   Wed, 11 Dec 2019 21:26:42 +0800
Labels:       <none>
Annotations:  debug.openshift.io/source-container: init-mydb
              debug.openshift.io/source-resource: /v1, Resource=pods/myapp-pod
              k8s.v1.cni.cncf.io/networks-status:
                [{
                    "name": "openshift-sdn",
                    "interface": "eth0",
                    "ips": [
                        "10.128.2.19"
                    ],
                    "dns": {},
                    "default-route": [
                        "10.128.2.1"
                    ]
                }]
              openshift.io/scc: anyuid
Status:       Pending
IP:           10.128.2.19
IPs:
  IP:  10.128.2.19
Init Containers:
  init-mydb:
......
Containers:
  myapp-container:
......
  myapp-container2:
    Container ID:  
    Image:         openshift/origin
......


[root@dhcp-140-138 ~]# oc debug -h
Launch a command shell to debug a running application

....
      --to-namespace='': Override the namespace to create the pod into (instead of using --namespace).

Comment 4 errata-xmlrpc 2020-01-23 11:17:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0062


Note You need to log in before you can comment on or make changes to this bug.