Skip to content

Adjustable sleep duration when SIGTERM received #7210

@harwck

Description

@harwck

Is your feature request related to a problem? Please describe.

In Kubernetes deployments, when new version of a deployment being rolled out, Kubernetes will continue sending traffic to pods in a TERMINATING state, so we will need to set terminationGracePeriod to a period, accordingly the application running in the container should also sleep and continue to handle incoming traffic until Kubernetes decided to stop sending traffic to it, the duration it takes for Kubernetes to stop sending traffic to pods in TERMINATING state sometimes depends on Cloud Providers or kube versions, so having a configurable sleep period in the termination signal handler might be a good idea.

Describe the solution you'd like

having a configurable sleep period in the termination signal handler might be a good idea.

Describe alternatives you've considered
I have tried:

  • Side car container sleeping
  • Copying sleep binary into /mnt and run that in the preStop hook

both aren't working well because it won't stop tyk itself from terminating

Additional context
Add any other context or screenshots about the feature request here.

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