title: Do Kubernetes pods still receive requests after receiving SIGTERM?
body: <p>I want to implement graceful shutdown in a Kubernetes Pod. I know I need to listen for SIGTERM, which indicates the start of the shutdown procedure. But what exactly do I do when I receive it?</p>
  
  <p>At the very least I must wait for all running request to finish before exiting. But can the pod still receive new requests after receiving the SIGTERM? (It's exposed using a service.) I can't find any explicit documentation on this.</p>
  
  <p><a href="http://kubernetes.io/docs/user-guide/pods/#termination-of-pods" rel="noreferrer">The docs</a> state:</p>
  
  <blockquote>
    <p>Pod is removed from endpoints list for service, and are no longer considered part of the set of running pods for replication controllers. Pods that shutdown slowly can continue to serve traffic as load balancers (like the service proxy) remove them from their rotations.</p>
  </blockquote>
  
  <p>So that seems to imply that new requests can still come in. So how long should I continue to expect new requests before graceful termination? Do I simply ignore the SIGTERM, continue to serve requests as usual and wait for the eventual SIGKILL?</p>
  
  <p>I suppose ensuring future readiness checks fail and then waiting longer than the period with which they occur before terminating might work?</p>
  
  <p>I'm on Kubernetes 1.2.5, if that makes any difference, and am talking about rolling updates in particular, but also scaling replication controllers down generally.</p>