最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

kubernetes - Using actuatorhealth when Spring application is deployed on k8s? - Stack Overflow

programmeradmin2浏览0评论

I wonder what the drawbacks of the Spring Boot application are that it has a /health actuator endpoint defined as liveness and readiness probes.

Are there any issues related to graceful shutdown or rolling updates?

I wonder what the drawbacks of the Spring Boot application are that it has a /health actuator endpoint defined as liveness and readiness probes.

Are there any issues related to graceful shutdown or rolling updates?

Share Improve this question asked Feb 7 at 16:32 pixelpixel 26.5k39 gold badges167 silver badges283 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Interesting question. I found this answer on Reddit.

Here is the big one that most people miss, though. Handling of SIGTERM events is a must in Kubernetes. Evictions, pod autoscalers, and just regular operation (like kubectl apply ...) can lead to pods getting killed prematurely. This happens by sending a SIGTERM event to the application. The readiness probe MUST respond differently than a liveness probe after the SIGTERM event has been received but before the app is able to exit. The readiness probe must return failure, while the liveness probe must return success. In this way, no new requests are sent to the terminated replica, but existing requests that are currently being processed are able to complete. After the liveness probe returns failure, Kubernetes may send a SIGKILL event, terminating your app immediately. In order for this to be handled properly, your liveness probe MUST remain healthy and your readiness probe MUST return failure. Of course, after the request in flight have been completed, your liveness probe should return failure, but only after all requests in flight have been completed.

发布评论

评论列表(0)

  1. 暂无评论