minikube: Persistent Volume Claims with a subPath lead to a "no such file or directory" error
BUG REPORT
Please provide the following details:
Environment:
Minikube version (use minikube version): minikube version: v0.24.1
- OS (e.g. from /etc/os-release): Arch Linux
- VM Driver (e.g.
cat ~/.minikube/machines/minikube/config.json | grep DriverName):Virtualbox - ISO version:
cat ~/.minikube/machines/minikube/config.json | grep -i ISO
"Boot2DockerURL": "file:///home/john/.minikube/cache/iso/minikube-v0.23.6.iso"
minikube ssh cat /etc/VERSION
v0.23.6
-
Install tools:
-
Others:
helm version
Client: &version.Version{SemVer:"v2.7.2", GitCommit:"8478fb4fc723885b155c924d1c8c410b7a9444e6", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.7.2", GitCommit:"8478fb4fc723885b155c924d1c8c410b7a9444e6", GitTreeState:"clean"}
VBoxManage --version
5.2.2r119230
What happened:
When attempting to install a pod resource, which has a VolumeMount with a subpath (like below):
"volumeMounts": [
{
"name": "data",
"mountPath": "/var/lib/postgresql/data/pgdata",
"subPath": "postgresql-db"
},
{
"name": "default-token-ctrw6",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
]
The pod fails to bind to the volume, with the following error:
PersistentVolumeClaim is not bound: "cranky-zebra-postgresql"
Error: lstat /tmp/hostpath-provisioner/pvc-f0db5074-d6b1-11e7-9596-080027aac058: no such file or directory
Error syncing pod
When subpath is not defined, this error does not happen.
What you expected to happen:
Creating a persisted volume claim with a subpath creates a directory which k8s can bind to.
How to reproduce it (as minimally and precisely as possible):
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm install stable/postgresql
Output of minikube logs (if applicable):
https://gist.github.com/johnhamelink/f8c3074d35ccb55f1203a4fa021b0cbb
Anything else do we need to know:
I was able to confirm that this issue didn’t affect a macbook pro with the following versions:
MacBook-Pro:api icmobilelab$ helm version
Client: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"}
MacBook-Pro:api icmobilelab$ minikube version
minikube version: v0.23.0
Virtualbox 5.1.22
I was able to get past this issue by manually creating the missing directory from iniside minikube by running minikube ssh.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 21
- Comments: 28 (7 by maintainers)
We can confirm there is an issue with persistent volume claims in minikube 0.24.1. We encountered the issue described after upgrading and attempting to deploy the concourse helm chart. This issue did not occur in minikube 0.23
This has been released now in v0.25.0
Found the solution. @southwolf @dyson . Delete the storage-provisioner.yaml file from the Minikube VM and delete the pod associated with the file:
kubectl delete pods/storage-provisioner -n kube-system. And then insert the file into /etc/kubernetes/addons/. The storage-provisioner pod should restart by itself@grimmy Exactly the same here.
This issue was fixed a while ago. When might we reasonably see a patch release of minikube? This is affecting a lot of people.
@grimmy Exactly the same here with Minikube 0.24.1
Error: lstat /tmp/hostpath-provisioner/pvc-6c84aa91-f04f-11e7-bf07-08002736d1ee: no such file or directory
I get this after “helm install stable/sonarqube” which also installs stable/postgresql
Is there going to be a release anytime soon with this patch?
@southwolf I’m using minikube inside Virtualbox (I’m running arch and
--vm-driver=nonewas a headache I wasn’t willing to work my way through just yet, lol).To clarify, when I see the
lstaterror, I’m runningmkdir -p <directory>thenchown docker:docker /tmp/hostpath-provisioner.