Migrate service that restart frequently to kubernetes

Hello,

I am trying to migrate a legacy vm based nodejs application to kubernete.
This application was design to look for information to process via ahttp post at start up. And if there’s no new information from the http post it will exit the application. In vm we had a parent monitoring process to watch the application termination and will cadence restart the application to try discover new information to process.
We do not plan to migrate the parent process to kubernete, and to my limited knowledge it will not a good practice and might bring the kubernete cluster to inefficient use if a pod keep exiting and kubernete need to keep restarting it.
I was wondering if there’s any best practice that I could read on to bring such application to kubernetes.

Thank you!

You are correct, a restarting pod isn’t a fun time for the cluster :wink: I used this package called “PM2” for nodejs apps in the past, it has some nice restart options to help restart the app without bringing the pod down.

Thank you, I will look into it.