I am using k3d to run local kubernetes
I have created a cluster using k3d.
Now I want to mount a local directory as a persistent volume.
How can i do this while using k3d.
I know in minikube
$ minikube start --mount-string="$HOME/go/src/github.com/nginx:/data" --mount
Then If you mount /data into your Pod using hostPath
, you will get you local directory data into Pod.
Is there any similar technique here also while using k3d
2
Answers
I think this feature is not yet available
https://github.com/k3d-io/k3d/issues/566
So far we can only mount volumn when we create a new cluster.
According to the answers to this Github question the feature you’re looking for is not available yet.
Here is some idea from this link:
According to this documentation one can use the following command with the adequate flag:
This command mounts volumes into the nodes
Example:
Here is also an interesting article how volumes and storage work in a K3s cluster (with examples).