Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lifecycle hooks, nodeSelector for serviceDefaults #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Jancis
Copy link
Member

@Jancis Jancis commented Dec 2, 2024

This PR implements couple changes:

  • nodeSelector for serviceDefaults;
  • preStop delay by default, allows pod to be removed from service backends, but delays the application shutdown for 15 seconds for existing requests to finish. This may solve nginx connection errors.

If application allows graceful shutdown, it can react to SIGTERM calls and handle them. Node application can shut down express server like so:

const server = app.listen( ..

process.on('SIGTERM', () => {
  console.log('SIGTERM signal received: closing HTTP server in 10 seconds')

  const closeServer = () => server.close()
  setTimeout(closeServer, 10000)
})

@Jancis Jancis requested a review from Rade333 December 2, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant