Skip to content

Graceful shutdown for Kubernetes #35

@alexellis

Description

@alexellis

There appears to be an issue with graceful shutdowns. This occurs when Kubernetes sends a SIGTERM to our function's Pod.

We have two processes:

  • of-watchdog
  • Go handler / HTTP server

The of-watchdog catches the signal and waits for wait_timeout env-var, but the child process appears to die immediately

We need to copy the code / approach of the of-watchdog into the Go handler for all templates and test.

Task

  • Show the issue by adding a SIGTERM handler and echo message in the entry point for one of the templates
  • Deploy in a container
  • Scale to --replicas=0
  • Look at the logs

Now fix the code and repeat

You should see that both processes wait at least wait_timeout before exiting.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions