k8s-node-termination-handler
k8s-node-termination-handler copied to clipboard
How to handle G2 soft off signal.
We are testing how to use Preemptible VM in GKE with this project. In the Preemptible VM document here said,
Compute Engine sends a preemption notice to the instance in the form of an ACPI G2 Soft Off signal. You can use a shutdown script to handle the preemption notice and complete cleanup actions before the instance stops.
In our test, if we do not block systemd to handle this signal, pod couldn't graceful shutdown.[1]
So my question is instead to monitor instance/preempted
event, how about to handle G2 soft off signal, is this a better way to perform?
Thanks.
[1] https://raw.githubusercontent.com/axot/examples/daisaru11/nginx-stresstest/staging/nginx-metrics/disable-powerkey.yaml
@mindprince I think this issue was discussed inside Google, I'm thinking about
- block G2 signal in OS side
- evict PODs using k8s-node-termination-handler
- shutdown OS to ensure all OS side processes could shutdown gracefully.
Any thoughts?