Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1560710 - Mounting socket files from subPaths fail
Mounting socket files from subPaths fail
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage (Show other bugs)
3.7.1
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.7.z
Assigned To: Hemant Kumar
Qin Ping
:
Depends On: 1563329 1558564 1563317 1563336
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-26 15:35 EDT by Hemant Kumar
Modified: 2018-05-17 23:55 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1558564
Environment:
Last Closed: 2018-05-17 23:54:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1576 None None None 2018-05-17 23:55 EDT

  None (edit)
Description Hemant Kumar 2018-03-26 15:35:17 EDT
+++ This bug was initially created as a clone of Bug #1558564 +++

Description of problem:

Mounting sockets or special files from subpaths fails.

Version-Release number of selected component (if applicable): 3.9.x

How reproducible:

Steps to Reproduce:
1. Create a pod definition that uses "/" as hostPath.
2. Try and mount something like "/run/docker.sock" as a subpath within a container.
3. The pod will fail to start

The reason of this regression is - openat system call being used on https://github.com/kubernetes/kubernetes/blob/master/pkg/util/mount/mount_linux.go#L1138 does not work for special files like Unix sockets and it will throw - Errno::ENXIO: No such device or address /run/docker.sock


Actual results:

The pod fails to start


Expected results:
The pod should start

--- Additional comment from Hemant Kumar on 2018-03-20 10:34:25 EDT ---

For now, while we make the fix. One possible workaround is to directly mount "/run/docker.sock" via a new volume entry and a new VolumeMounts entry that does not uses subpath.

Something like:

VolumeMounts: [
{ mountPath: "/run/docker.sock", name: docker_sock, readOnly: true}
],
volumes: [
{ name: docker_sock,
hostPath: { path: "/run/docker.sock", type: "" },
]

--- Additional comment from Hemant Kumar on 2018-03-22 16:41:08 EDT ---

PR upstream for the fix https://github.com/kubernetes/kubernetes/pull/61480

--- Additional comment from Hemant Kumar on 2018-03-26 11:30:50 EDT ---

Opened PR for Openshift/origin - https://github.com/openshift/origin/pull/19100
Comment 3 Qin Ping 2018-04-17 03:15:58 EDT
Verify failed in OCP v3.7.44

Still report: Error: failed to prepare subPath for volumeMount "dynamic" of container "testpod"
Comment 5 Hemant Kumar 2018-04-23 12:50:37 EDT
PR is still merged. MODIFIED is correct state of the BZ.
Comment 7 Qin Ping 2018-05-08 23:33:24 EDT
Verified in OCP: v3.7.46

# uname -a
Linux host-172-16-120-34 3.10.0-693.11.1.el7.x86_64 #1 SMP Fri Oct 27 05:39:05 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.4 (Maipo)
Comment 10 errata-xmlrpc 2018-05-17 23:54:45 EDT
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-2018:1576

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