shutdown.delay=0s # rolling update starts in 30 seconds $ sleep 30; kubectl rollout restart deployment graceful-shutdown shutdown.delay=5s # rolling update starts in 30 seconds $ sleep 30; kubectl rollout restart deployment graceful-shutdown
如果想了解更多相关信息,可以参考下面的一些链接: https://learnk8s.io/graceful-shutdown https://freecontent.manning.com/handling-client-requests-properly-with-kubernetes
本文的完整代码在 https://github.com/wupeixuan/SpringBoot-Learn 的 graceful-shutdown 目录下。
本文的完整代码在 https://github.com/wupeixuan/SpringBoot-Learn 的 graceful-shutdown 目录下。
本文的完整代码在 https://github.com/wupeixuan/SpringBoot-Learn 的 graceful-shutdown 目录下。
|-- favicon | | | | |-- favicon.ico | | | | `-- main.go | | | |-- graceful-shutdown | | | | |-- close | | | | | `-- server.go | | | | `-- graceful-shutdown
graceful-shutdown/main.go package main // imports var wg sync.WaitGroup func main() { ctx, stop
原文地址:https://learnk8s.io/graceful-shutdown 文章转载自K8sMeetup社区。
通过 AddShutdownHookFunc() 来添加 shutdownhook 函数。
本文翻译自:https://learnk8s.io/graceful-shutdown 在Kubernetes中,创建和删除Pod是最常见的任务之一。