I am new to kubernetes. I have Rest Api running in a pod through which we are uploading a file and storing that on pod's local pvc. I want to create a new pod in my kubernetes cluster whenever new file is uploaded in persistence storage PVC. Any guidance how to achieve this?
Asked
Active
Viewed 125 times
0
-
Could you add some more context to this question. If you have a PVC already then it is attached to some k8s object , the application running in the pod of that object must trigger a new pod on addition of new file , is that what you are expecting. Also how are files being uploaded to PVC. Are you on any cloud ? – Tarun Khosla May 18 '22 at 06:32
1 Answers
0
If I understand correctly, I think you can monitor files created on the host where they are stored and then invoke the kubernetes API to create the pod. See the links below for pod creation.

zilex
- 61
- 4
-
creating pod through rest api that can be done with this. how to monitor the files? – Rahul Raut May 18 '22 at 06:58
-
you can use inotify to watch files from filesystem. https://pkg.go.dev/k8s.io/utils/inotify. for the python version see also https://pypi.org/project/inotify/ – zilex May 18 '22 at 07:38