-
Notifications
You must be signed in to change notification settings - Fork 374
k8s subPath is not supported by Kata #2812
Comments
Had some help taking a look at this, and observed that subPath is handled completely by Kubelet, and isn't passed through to CRI / OCI. Asa. result, there isn't a way for Kata to support volume subPaths today. |
Thanks for the follow-up. As mentioned above, I've since implemented a workaround so I'm not blocked on this in any case - so feel free to triage this going forward however you wish. Thanks for the detailed look into the issue! |
This issue is being automatically closed as Kata Containers 1.x has now reached EOL (End of Life). This means it is no longer being maintained.
This decision was discussed by the @kata-containers/architecture-committee and has been announced via the Kata Containers mailing list:
If you believe this issue still applies to Kata Containers 2.x, please open an issue against the Kata Containers 2.x repository, pointing to this one, providing details to allow us to migrate it. |
Description of problem
I have a use case where I would like to copy a subdirectory from the host into the pod. I've been doing this without Kata for quite a while successfully, using the tried-and-true method of running an initContainer that has both an emptyDir (rw) and a host-volume (ro) mounted, and basically running
cp -r
to copy from the read-only volume into the read-write emptyDir volume. The when mounting this volume to the main container of the pod, I do so with thesubPath
option, which I rely upon to simplify things for users. As I mentioned, this has worked great with other runtimes.However, when running the pod with kata, and no other configuration changes, the volume is mounted to the correct location, but the directory itself is empty. I don't expect it to be, and can confirm that its not within the init container by running
ls
in the chain of commands there. I've narrowed the culprit down to the presence of thesubPath
option for the volumeMount to the main container. Without this option, everything works great on Kata, but obviously the whole volume is mounted, rather than a subdirectory; as I mentioned, thesubPath
option enables me to simplify things for the users of our platform and I'd like to continue to use it.Expected result
The below pod definition works great. First, the init container fires and creates the relevant directories and file. Then, the main container runs sleep so we can have some time to
exec
into it and see what it has:Since I'm using the
subPath
option, I can look at the contents of/foo
and see the fileHELLOTHERE
right there:I suppose that what I expected was that running this on Kata containers (adding the relevant runtimeclass option) wouldn't change this behavior, but it seems to.
Actual result
I recreated the pod by only adding the necessary runtimeclass reference:
For reference, here's my runtimeclass definition:
Re-running this test shows nothing. The directory mount exists, but is empty:
I'm opening this because I think this may be unexpected behavior (some basic searches of issues and docs don't give me the impression this is expected behavior), but happy to be corrected.
Thanks in advance for your help.
Show kata-collect-data.sh details
Meta details
Running
kata-collect-data.sh
version1.11.0-rc0 (commit f7f5d42390b15b416f198570d7778dc09725a1d0)
at2020-07-02.00:20:37.770878084+0000
.Runtime is
/usr/bin/kata-runtime
.kata-env
Output of "
/usr/bin/kata-runtime kata-env
":Runtime config files
Runtime default config files
Runtime config file contents
Config file
/etc/kata-containers/configuration.toml
not foundOutput of "
cat "/usr/share/defaults/kata-containers/configuration.toml"
":KSM throttler
version
Output of "
/usr/libexec/kata-ksm-throttler/kata-ksm-throttler --version
":Output of "
/usr/lib/systemd/system/kata-ksm-throttler.service --version
":systemd service
Image details
Initrd details
No initrd
Logfiles
Runtime logs
No recent runtime problems found in system journal.
Proxy logs
No recent proxy problems found in system journal.
Shim logs
No recent shim problems found in system journal.
Throttler logs
No recent throttler problems found in system journal.
Container manager details
No
docker
Have
kubectl
Kubernetes
Output of "
kubectl version
":Output of "
kubectl config view
":Output of "
systemctl show kubelet
":No
crio
Have
containerd
containerd
Output of "
containerd --version
":Output of "
systemctl show containerd
":Output of "
cat /etc/containerd/config.toml
":Packages
No
dpkg
Have
rpm
Output of "
rpm -qa|egrep "(cc-oci-runtimecc-runtimerunv|kata-proxy|kata-runtime|kata-shim|kata-ksm-throttler|kata-containers-image|linux-container|qemu-)"
":The text was updated successfully, but these errors were encountered: