feat: Add custom CRI-O storage paths with automatic bind mount
Add support for custom CRI-O storage paths with automatic bind mounts
Implements automatic sharing of Podman host images with CRI-O in minikube by allowing users to specify custom storage paths that are automatically bind-mounted into the container.
This enhancement adds two new flags:
- --container-storage-root: Specifies custom CRI-O storage root path
- --container-storage-runroot: Specifies custom CRI-O runtime root path
When these flags are used with KIC drivers (Podman/Docker) and CRI-O runtime, the specified directories are automatically:
- Bind-mounted from host to container at the same paths
- Configured in CRI-O's configuration file
- Used by CRI-O for image storage
This eliminates the need for manual kicbase modifications or image loading when using Podman as the driver with CRI-O runtime.
Fixes #17415
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: vtri950 Once this PR has been reviewed and has the lgtm label, please assign spowelljr for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
- :x: - login: @v-ware / name: vtripathi. The commit (205cedb93760bcb6e3a5b402ab27f989dc92b431) is not authorized under a signed CLA. Please click here to be authorized. For further assistance with EasyCLA, please submit a support request ticket.
Welcome @vtri950!
It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes/minikube has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @vtri950. Thanks for your PR.
I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Can one of the admins verify this patch?
@medyagh absolutely!
it starts with this https://github.com/podman-desktop/podman-desktop/issues/2866 the current setup of podman with kind has a manual step of loading images in kind container after podman builds them we wanted to automate that process
so @benoitf and @afbjorklund came up with soln using minikube to do that https://gist.github.com/benoitf/3e45effb48e27791282eb227410f5950
but this required to run the cluster on kicbase image and to avoid that they openend this issue https://github.com/kubernetes/minikube/issues/17415
and my pr fixes that
i have tested it on my wsl(ubuntu) for podman with rootless and in windows with a podman vm(rootful) and it works as expected
you can build your images with podman and directly run your container inside minikubbe cluster without having that extra manual load step
/cc @afbjorklund
can you provide an example of running this new feature ?
There was a blog post about it at the time, but just like the minikube preloads it increases the coupling... i.e. it assumes that you can mount the internals of the images from another incarnation of the runtime
https://podman-desktop.io/blog/sharing-podman-images-with-kubernetes-cluster
I know it speeds things up, especially with large images, but using the cache or save/load is much easier. Currently the preferred approach is to access the cluster with minikube docker-env and build from there.
The flags look harmless enough though, since by default they don't do anything.
I don't remember why it was better to configure the runtime, versus just mounting a docker volume over it.
# CRI-O reads its storage defaults from the containers-storage.conf(5) file
# located at /etc/containers/storage.conf. Modify this storage configuration if
# you want to change the system's defaults. If you want to modify storage just
# for CRI-O, you can change the storage configuration options here.
[crio]
# Path to the "root directory". CRI-O stores all of its data, including
# containers images, in this directory.
# root = "/var/lib/containers/storage"
# Path to the "run directory". CRI-O stores all of its state in this directory.
# runroot = "/run/containers/storage"
# Path to the "imagestore". If CRI-O stores all of its images in this directory differently than Root.
# imagestore = ""
Maybe there were some clues in https://github.com/kubernetes/minikube/issues/17415
@vtri950: GitHub didn't allow me to request PR reviews from the following users: benoitf.
Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.
In response to this:
/cc @benoitf
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.