Bug 1975553 - Windows pod with a Projected Volume is stuck at ContainerCreating
Summary: Windows pod with a Projected Volume is stuck at ContainerCreating
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Windows Containers
Version: 4.7
Hardware: x86_64
OS: Windows
urgent
urgent
Target Milestone: ---
: 4.7.z
Assignee: Aravindh Puthiyaparambil
QA Contact: gaoshang
URL:
Whiteboard:
Depends On: 1973580
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-23 22:06 UTC by OpenShift BugZilla Robot
Modified: 2021-07-08 08:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Windows Pods with a Projected Volume and with a RunAsUser present in the Pod's SecurityContext results in os.Chown() being executed for entities being projected. Consequence: os.Chown() is not implemented for Windows and results in an error being thrown and the Pod is stuck in ContainerCreating. Fix: Don't execute os.Chown() if the kubelet is running on Windows Result: Pods go to running
Clone Of:
Environment:
Last Closed: 2021-07-08 08:48:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift kubernetes pull 826 0 None open [release-4.7] Bug 1975553: only chown if non-windows machine with projected volumes 2021-06-25 17:41:34 UTC
Github openshift windows-machine-config-operator pull 501 0 None open Bug 1975553: [submodule][kubernetes] Update to d0b1ad449a0 2021-06-30 22:11:57 UTC
Red Hat Product Errata RHBA-2021:2671 0 None None None 2021-07-08 08:48:54 UTC

Comment 1 Aravindh Puthiyaparambil 2021-06-28 21:38:35 UTC
This bug needs to be fixed and released as part of WMCO 2.0.2.  This is a requirement for the WMCO 3.0.0 release, to prevent Windows Pods from not coming after an upgrade from 4.7 to 4.8.

Comment 2 gaoshang 2021-07-02 09:27:07 UTC
This bug has been verified on 4.7.0-0.nightly-2021-07-01-234327 and passed, thanks.

Version-Release number of selected component (if applicable):
WMCO commit: 0a9fd1d1d820905673f82c6ec8f1eda558c411f6
OCP build: 4.7.0-0.nightly-2021-07-01-234327

Steps:
1, Build WMCO from release-4.7 branch and install the operator on OCP 4.7
2, Bootstrap Windows node
3, Create the Secrets for Projected Volume
oc new-project winc-test
echo -n "admin" > ./username.txt
echo -n "1f2d1e2e67df" > ./password.txt
oc create secret generic user --from-file=./username.txt
oc create secret generic pass --from-file=./password.txt

4, Create Windows Pod with Projected Volume
e.g.
oc create -f https://raw.githubusercontent.com/sgaoshang/winc-test/master/data/WinWebServer_Projected_Volume.yaml

5, Check creating Windows pod with a Projected Volume succeed and the projected-volume directory contains your projected sources

# oc get pod -owide
NAME                            READY   STATUS    RESTARTS   AGE   IP           NODE                                         NOMINATED NODE   READINESS GATES
win-webserver-796c99c67-8zlrt   1/1     Running   0          13m   10.132.3.2   ip-10-0-128-108.us-east-2.compute.internal   <none>           <none>

# oc exec -it win-webserver-796c99c67-8zlrt powershell
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved. 

PS C:\> ls .\projected-volume\ 


    Directory: C:\projected-volume 


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         7/2/2021   9:13 AM                ..2021_07_02_09_13_40.423701902
d----l         7/2/2021   9:13 AM                ..data
-a---l         7/2/2021   9:13 AM              0 password.txt
-a---l         7/2/2021   9:13 AM              0 username.txt


PS C:\> cat .\projected-volume\username.txt 
admin 
PS C:\> cat .\projected-volume\password.txt  
1f2d1e2e67df

Comment 5 errata-xmlrpc 2021-07-08 08:48:51 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 (Windows Container Support for Red Hat OpenShift 2.0.2 product release), 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-2021:2671


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