Is there any recommended way to gracefully shutdown a Spring:boot 2 app in Kubernetes.
- Catch a termination signal SIGTERM
- Tell Tomcat to stop taking new requests. (or Jetty, Undertow or Netty/WebFlux depending on the embedded web server used). Or tell SCS to stop sending/listening for messages on Kafka.
- Tell Actuator health endpoint to go SERVICE_UNAVAILABLE (503)
- And then after a X seconds shutdown the application or (SIGKILL)
I'm trying to do a graceful shutdown Rest apps and SCS (kafka consumer&producer) apps