https://rancher.com/ logo
Title
l

limited-microphone-86044

12/25/2022, 6:04 PM
Hi having trouble with Kubernetes pod data. I have installed created a Kubernetes pod and copied/saved data in the pod (created a folder "*app"* and saved data in it). When I exit rancher desktop and switch off my PC and restart rancher desktop next day all the data is lost which I saved inside the pod. Can any one please help.
Can any 1 check this issue please!!
s

sticky-summer-13450

12/26/2022, 10:58 AM
The data in Kubernetes pods is ephemeral, just like data saved in Docker containers - the moment the container is removed the data in the container is gone. To have persistent data you have to use a volume, just like Docker. In Rancher Desktop (depending on the OS you are running it on) you can use parts of the local file-system as in Persistent Volumes. https://docs.rancherdesktop.io/faq/
Q: Does file sharing work similarly to Docker Desktop? Do I have to do any additional configuration to mount volumes to VMs?
A: Currently, the following directories are shared by default: `/Users/$USER` on macOS,
/home/$USER
on Linux, and
/tmp/rancher-desktop
on both. For Windows, all files are automatically shared via WSL2.
l

limited-microphone-86044

12/26/2022, 11:45 AM
I am Running Rancher-Desktop in Windows. So I need to attach Persistent data volume to the pod. And using this it work like docker container when I restart and run it it will show the data saved ??
­čĹŹ 1
Will try it and get back thank you