-1

recrently i have a task to store the files which was uploaded in the website to my worker node in the eks cluster. i have used pv and pvc for that task. but the problem is , when i go to the specified location in worker node the uploaded files were not found. so what can i do?

enter image description here

i need a answer for that to resolve that issue.

David Maze
  • 130,717
  • 29
  • 175
  • 215
nethaaji
  • 1
  • 1

1 Answers1

0

Kubernetes nodes are ephemeral, which means data should not be stored on the node itself, which is why PVs are used. PVs are seperate disks that are attached to the node, so when the node goes down data isnt lost.

If you want to see the data stored in a PV/PVC, you should use kubectl exec to get a shell inside the pod that mounts the PVC, then navigate to the mount path.

If you dont care about losing the data, you might want to use the emptyDir, and check the data using kubectl exec.

This example should give you a good idea how things work.

akathimi
  • 1,393
  • 11
  • i have used the pv and pvc to my statefulset file , but the problem is i cant able to see the uploaded files in the conatiner or worker node. – nethaaji Aug 31 '23 at 07:50
  • the files will be located in the 'mountPath' specified in the pod manifest. You wont be able to access them from the node. If the directory is empty, then the application isnt writing to it. – akathimi Aug 31 '23 at 08:02
  • okay then how can i make the application to wirite into it , i need to see the files which i uploaded onto the website ... help me to resolve this. – nethaaji Aug 31 '23 at 08:07
  • check with the app developers on how to specify the files destination – akathimi Aug 31 '23 at 08:30
  • i had a issue with the pv and pvc .......i need to update it ......so kindly help me with this... – nethaaji Aug 31 '23 at 09:54
  • i configured the correct path – nethaaji Aug 31 '23 at 09:54
  • bro i have also checked inside the container but there was no data there. – nethaaji Sep 01 '23 at 09:37