aws / amazon-eks-pod-identity-webhook

Amazon EKS Pod Identity Webhook
Apache License 2.0
620 stars 175 forks source link

gracefully terminate on SIGTERM #211

Closed kmala closed 9 months ago

kmala commented 9 months ago

Issue #, if available:

Description of changes: Currently the pod identity container wouldn't exit on SIGTERM because metricsServer is not handling the signal and would only exit on SIGKILL. Adding signal handling to the metric server also such that server is gracefully shutdown on SIGTERM

We can now see the graceful shutdown log after the change

I0221 21:37:52.906702      11 reflector.go:377] k8s.io/client-go/informers/factory.go:159: forcing resync
I0221 21:38:42.900211      11 file_watcher.go:91] context closed, stopping FileWatcher
I0221 21:38:42.900305      11 main.go:319] Graceflully closed

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

nnmin-aws commented 9 months ago

/lgtm

nnmin-aws commented 9 months ago

/lgtm

nnmin-aws commented 9 months ago

LGTM!