-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Driver: none host path should be /var/tmp
for PVCs
#7511
Comments
The paths under |
Oh sorry for the lack of detail. My problem is present when using the |
I know, but when you are using the |
Moving the temporary mountpoint from There was also the issue with the storage-provisioner pod mounting the |
I don't see why you would need to do that. Installing docker makes sense but minikube takes care of creating the
I only partly agree that this is a workaround. Under the assumption that most users that are using the However, if it is configurable then that kills 2 birds with one stone. I still believe that the default should be |
It could, but it would be more meaningful to store "persistent" data in a non-tmp directory ? So the plan was to allow to select something similar to But So the user can select something appropriate ? See also |
@jradtilbrook it is not a bug, by default minikube provisions ephemereal storage, which resides in /tmp by convention. the version of minikube you are using is not affected by the bug @afbjorklund mentions (#7218) so if you want data to persist upon reboots, you have to use storage classes and persistent volumes. and if you update to the latest minikube version and start being affected by #7218 then also storage classes and persistent volumes to force the hostPath folder is to be enforced. |
That is not just true, it is only an unfortunate oversight when using the All persistent volumes are supposed to be persistent, by mounting a persistent location. The workaround is to do a similar setup as is done in the minikube.iso, but on the host: mkdir -p /var/tmp/hostpath-provisioner
mkdir /tmp/hostpath-provisioner
sudo mount --bind /var/tmp/hostpath-provisioner /tmp/hostpath-provisioner At the moment the |
very short and quick workaround indeed, thank you. |
Okay, in the meantime I will also use that bind mount. And it seems like the answer to this issue is to parameterise the directory used for PVCs, which will be resolved in one of #3318 or #5144. Is that correct? If so, I'll close this issue and can carry on any discussion on whichever of those you would prefer - I am still willing and able to provide a PR for this, but parameterisation logic will just take more time for me to implement. |
For fixing this problem on my Ubuntu (using docker driver), I had to run this replacements command to the ones mentioned: minikube ssh
sudo su
echo '/var/tmp/hostpath-provisioner /tmp/hostpath-provisioner none defaults,bind 0 0' > /etc/fstab |
This seems reasonable: the P in PVC is persistent after all. I think it would just take modifying this line: minikube/cmd/storage-provisioner/main.go Line 28 in 39958f2
Anyone up for doing so and testing it? |
I actually think that isn't all that's needed. The storage provisioner addon mounts a hostpath of So I think modifying this line:
Happy to provide a PR! |
But it is still just a workaround, Note that |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
This has been fixed on my minikube installation (with docker driver). Thanks a lot! |
For drive=none, I added the file /etc/tmpfiles.d/tmp.conf and filled it in as follows: now the /tmp/hostpath-provisioner folder is persistent ;) |
Sorry in advance but the issue template really does not apply at all to my issue.
Abstract
When using the none driver in a linux environment I get issues with PVCs after restarting. This is due to the
/tmp
directory being atmpfs
filesystem.Details
Many mainstream linux distributions adopted systemd as the init system quite a while ago, and under this system, the
/tmp
directory is managed as a mount service and is mounted as atmpfs
filesystem. This is ideal for performance since it uses memory for anything in that directory. My issue is that when I have a pod that uses a persistent volume claim and I restart my machine the directory backed by the host is cleared (since it was in memory). This causes the pod to not start back up when I start minikube. I can get around this by disabling thetmp.mount
systemd service (and therefore let it default to the disk in my machine) and adding some rules to not clean up thehostpath-provisioner
directory inside/tmp
but this is highly undesirable since many other applications use the directory and benefit fromtmpfs
. I don't want to have to do that just so PVCs will work in minikube.If you see this article describing the tmp system interaction with systemd they recommend using
/var/tmp
for temporary storage that is not in memory and hence can be configured to remain after reboots. I think the minikube binary should be modified to use this directory instead. This will solve my issue with PVCs and allow me to keeptmp
astmpfs
.I'm willing to provide a PR, granted the maintainers understand my problem and agree with my proposed solution. Otherwise, if there are other ideas on how to resolve this I'd love to know and contribute any way I can. Cheers!
The text was updated successfully, but these errors were encountered: