-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customise Docker volume #1834
Comments
All docker volumes can grow arbitrarily large, is there a reason to not move all of them? What particular volumes we create is an implementation detail subject to change at any time. |
Hi @BenTheElder , thanks for the quick reply! |
I don't think docker provides a mechanism to place an anonymous volume on a different disk. If there is a mechanism that I'm not aware of to place anonymous volumes on another disk, we could support an enviornment variable to point kind to a different anonymous volume location. I don't think we should switch to named volumes for these as that guarantees users will expect to depend on them, and this is a highly internal detail that can and has changed in order to keep kind functioning well. |
This works for me:
That sounds great! 👍
Well, I'd argue it's not really internal since anyone can just Ultimately I think this issue isn't too different from what happened with the network customisation. People running kind on different environments with different capabilities will need to customise how kind will run. |
That's not an anonymous volume. Anonymous volumes sometimes come from the image spec even and are bound to the container lifecycle. Obscured volume names that are bound to the lifecycle of the node do very much signal that the existence and contents of these are not to be relied on. We've changed them multiple times to fix things. We also avoid cleanup bugs by letting docker bind their lifecycle to the container (anonymous + RM option)
You can't really do anything here you couldn't do more sanely with host paths inside the node which is expected. You can't change the volume itself in any way, you can use the contents but obviously you're risking a dependency on arbitrary volumes which users probably won't do and we explicitly will not support.
Which network customization are you referring to? We don't really have anything comparable to this. The network used is a single entity that is unavoidably public and we have intentionally documented it. |
I recommend moving your anonymous volumes storage under dockerd to the high capacity disk and opting specific known public volumes into using the fast disk instead. Docker already has a configurable data root etc. I'm not keen on creating bind mounts for these (where users will then depend on the contents being present on the host) and it's not portable anyhow. Bind mounts have different meaning across the docker desktop platforms. How docker internally implements the existing volumes is something users could try to work around but then they're depending on docker's internals which we're obviously not going to support and should be a red flag when thinking about doing this. |
Ah, you mean anonymous at container creation time, gotcha. 👍
In that case, this should do it:
That volume will be bound to the lifecycle of the container, though obviously not its contents. Also, granted it's not portable.
--volume to using --mount (which BTW is recommended according to the docs for some reason), then check for that variable and merge/append its contents.
I meant this: #1538 |
The volume and it's contents are supposed to be created and deleted with the container.
AFAICT that recommendation does not apply to anonymous volumes, like we're using here. As I said before some of these volumes have even come from
This is just one object name, and I think we're going to remove this, it's not necessarily a good pattern, and we're mostly seeing users try to use networks that won't work anyhow. I think a bit of additional context is still missing here ...
The current PR design will be broken by these changes. |
If I set just the volume option for a device path like /dev/sda2 (not a bind mounted path) what happens? If we have to switch to bind mounts that we generate ourselves instead of arbitrary customization of the volumes and trying to reconcile which volumes exist in the future, perhaps we could support a concept akin to DOCKER_DATA_ROOT. |
I think I have a more elegant solution for the next revision: we can support node Then you can create a docker volume as you see fit and mount it to /var without the awkward volume options env, and if kind changes the volumes used in the future you can continue to select portions of the filesystem to be redirected to your volumes which will be unioned with the volumes we actually create. |
#1966 subsumes this. |
It would be great if users could customise the docker volume created by kind on cluster creation.
Currently the volume is anonymous so it's hard to identify it in
docker volume ls
.Also because it grows big with all the images and stuff I'd like to put it on a different host partition instead of the default /var/lib/docker/volumes .
I guess the implementation for this would go in
kind/pkg/cluster/internal/providers/podman/util.go
Line 76 in 4d5b73e
(or just write a different function)
The text was updated successfully, but these errors were encountered: