<p>I don't clearly understand process of scaling down in openshift. I know openshift sends SIGTERM signal on one of microservice pods and application start to destroy gracefully and openshift stops send traffic on this pod. But on which order it going on? Firstly openshift stops send traffic and after that sends SIGTERM to pod?
And how openshift know when pod was destroyed? Does it based on liveness/readness probes?</p>

tosha220
<blockquote>
  <p>But on which order it going on? Firstly openshift stops send traffic and after that sends SIGTERM to pod? </p>
</blockquote>

<p>Yes, OpenShift(Kubernetes) remove the pod endpoint before SIGTERM.
The terminating process order is as follows, refer <a href="https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-terminating-with-grace" rel="nofollow noreferrer">Kubernetes best practices: terminating with grace</a> for more details.</p>

<p>1 - Pod is set to the “Terminating” State and removed from the endpoints list of all Services</p>

<p>2 - preStop Hook is executed</p>

<p>3 - SIGTERM signal is sent to the pod</p>

<p>4 - Kubernetes waits for a grace period</p>

<p>5 - SIGKILL signal is sent to pod, and the pod is removed</p>

<blockquote>
  <p>And how openshift know when pod was destroyed? Does it based on liveness/readness probes?</p>
</blockquote>

<p>OpenShift(Kubernetes) keeps sync the pod status with containr runtime(cri-o, docker ...) regularly. Further information is here: <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/pod-lifecycle-event-generator.md" rel="nofollow noreferrer">Kubelet: Pod Lifecycle Event Generator (PLEG)</a>.</p>
