k8s-node-termination-handler icon indicating copy to clipboard operation
k8s-node-termination-handler copied to clipboard

How to handle G2 soft off signal.

Open axot opened this issue 4 years ago • 1 comments

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

axot avatar Mar 18 '20 07:03 axot

@mindprince I think this issue was discussed inside Google, I'm thinking about

  1. block G2 signal in OS side
  2. evict PODs using k8s-node-termination-handler
  3. shutdown OS to ensure all OS side processes could shutdown gracefully.

Any thoughts?

axot avatar Apr 16 '20 06:04 axot