How to have a pod terminate after running a script?
I'm deploying pods using the python sdk. It allows you to set the arguemnt
dockerArgs
, which will "override the container start command". I'd like to use this to run a custom script and then have the pod terminate automatically after the script finishes.
However, I can't get the pod to actually finish. I tried setting dockerArgs="/bin/bash /my_persistent_volume/start.sh"
where start.sh is taken from here but with the "sleep infinity" line removed at the end of the file.
When checking the logs, it appears that the start.sh script is actually running every 15 seconds rather than running once and then terminating the pod.
How can I have a pod run a script once and then terminate itself when finished?
Thanks!0 Replies