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?
But on which order it going on? Firstly openshift stops send traffic and after that sends SIGTERM to pod?
Yes, OpenShift(Kubernetes) remove the pod endpoint before SIGTERM. The terminating process order is as follows, refer Kubernetes best practices: terminating with grace for more details.
1 - Pod is set to the “Terminating” State and removed from the endpoints list of all Services
2 - preStop Hook is executed
3 - SIGTERM signal is sent to the pod
4 - Kubernetes waits for a grace period
5 - SIGKILL signal is sent to pod, and the pod is removed
And how openshift know when pod was destroyed? Does it based on liveness/readness probes?
OpenShift(Kubernetes) keeps sync the pod status with containr runtime(cri-o, docker ...) regularly. Further information is here: Kubelet: Pod Lifecycle Event Generator (PLEG).