Bug 1990014
Summary: | oc debug <pod-name> does not work for Windows pods | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Mansi Kulkarni <mankulka> |
Component: | oc | Assignee: | Ross Peoples <rpeoples> |
oc sub component: | oc | QA Contact: | zhou ying <yinzhou> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | high | ||
Priority: | high | CC: | aos-bugs, aravindh, maszulik, mfojtik, mohashai, team-winc, yinzhou |
Version: | 4.9 | Flags: | mohashai:
needinfo+
|
Target Milestone: | --- | ||
Target Release: | 4.10.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause: oc debug previously assumed it was always targeting Linux-based containers by trying to run a Bash shell.
Consequence: Attempting to debug a Windows container if Bash was not present in the container.
Fix: oc debug now uses pod selectors to determine the OS of the containers, and tries to run the cmd.exe shell for Windows containers.
Result: oc debug now works on both Linux and Windows-based containers.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2022-03-11 18:15:11 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Mansi Kulkarni
2021-08-04 14:54:49 UTC
@maszulik Why has this been passed back to the Windows Container team? This is an issue with how oc handles the debug command for Windows and has nothing to with the Windows Machine Config Operator which is what the WinC team owns. After the discussion with workloads team passing this bug back to the team. Points to be considered for fixing this bug: Windows pod spec is expected to have set the tolerations for host: nodeSelector: kubernetes.io/os: windows node.kubernetes.io/windows-build: '10.0.17763' tolerations: - key: "os" operator: "Equal" value: "windows" effect: "NoSchedule" ref: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host However the above taints and tolerations are recommended and not guaranteed to be present, in such cases we should do a best effort for Windows pods and fallback to /bin/sh where the OS can't be figured out. It is also required to fix the oc debug pod command for a feature console team is adding to the admin console that allows to debug pod containers from the UI. This appears to be fixed in the latest oc version, I tried version 4.9.15 and it works. [root@localhost ~]# oc debug node/ip-10-0-137-166.us-east-2.compute.internal error: cannot debug ip-10-0-137-166.us-east-2.compute.internal: can't debug Windows nodes [root@localhost ~]# oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.10.0-0.nightly-2022-01-25-023600 True False 64m Cluster version is 4.10.0-0.nightly-2022-01-25-023600 @yinzhou , did you verify that `oc debug <podname>` works? |