Home > Mobile >  Does kubernetes sends kill signal to pm2 if an new deployment comes in?
Does kubernetes sends kill signal to pm2 if an new deployment comes in?

Time:06-22

I have a microservice running in kubernetes with deployment. It is serving a Node JS application with PM2. I recently found whenever I deploy a new version of application with helm, i can see PM2 is being exited with code [0]

PM2 log: App [api.bundle:0] exited with code [0] via signal [SIGINT]

I tried to investigate if there is an exception in application. Could not found any error prior deployment. That leads me to ask if how pm2 is getting restarted? Does kubernetes sends kill signal to pm2 if an new deployment comes in?

CodePudding user response:

...whenever I deploy a new version of application with helm, i can see PM2 is being exited with code [0]

When you do helm upgrade the command triggers rolling update to the deployment which replace existing pod(s) with new pod. During this process, signal [SIGINT] was sent to inform your PM2 container it's time to exit.

...if how pm2 is getting restarted? Does kubernetes sends kill signal to pm2 if an new deployment comes in?

Correct.

CodePudding user response:

First it will send TERM signal after grace period it will send KILL. Please refer kubernetes documentation for more details

  • Related