I have a multi-container pod in k8s, let's call them A and B. When stopping the pod, A must stop before B because A needs B until it's off.
To do that, I registered a preStop hook on A so A can gracefully stop before B.
However I'm not sure this is a good solution, because I miss some information I can't find in k8s documentation:
What happens when a multi-container pod is stopped?
- All containers
preStophooks are called, then when they are all over all containers receiveSIGTERM, or - In parallel, all containers receive
preStopif they have one or directlySIGTERMif they don't?
In the second case, preStop is useless for what I want to do as B will be instantly killed.