Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mount host path directories instead of sockets
So far we’ve tried to mount individual host files which are needed in the containers, to limit the exposure. However this doesn’t work well for sockets: because the consuming end can’t create them, they need to be mounted as files, and because Kubernetes (or CRI) doesn’t support “opportunistic” mounts, their type can’t be specified; as a result, if the container starts before the process which opens the socket, the mount ends up being created as a directory, and the process trying to open the socket then fails. There are two potential fixes for this: * if the operator could determine conclusively which socket mounts are required for a container, it could define only the necessary mounts, and have the container block waiting for them to be available; * as done in ovnkubernetes, the containers can mount the containing directories. The first approach seems preferable but creates a strong dependency on specific behaviours from the cluster environment (specific paths used by specific versions of OpenShift components in specific scenarios). The second isn’t great from a security perspective but seems like the best compromise. /var/run is a symlink to /run; this also changes the various paths to use canonical paths and merges the duplicates. Signed-off-by: Stephen Kitt <skitt@redhat.com>
- Loading branch information