<p>I'm currently running on AWS and use <a href="https://github.com/kube-aws/kube-spot-termination-notice-handler" rel="noreferrer">kube-aws/kube-spot-termination-notice-handler</a> to intercept an AWS spot termination notice and gracefully evict the pods.</p>

<p>I'm reading <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/preemptible-vm" rel="noreferrer">this GKE documentation page</a> and I see:</p>

<blockquote>
  <p>Preemptible instances terminate after 30 seconds upon receiving a preemption notice.</p>
</blockquote>

<p>Going into the Compute Engine documentation, I see that a ACPI G2 Soft Off is sent 30 seconds before the termination happens but <a href="https://github.com/kubernetes/kubernetes/issues/22494" rel="noreferrer">this issue</a> suggests that the kubelet itself doesn't handle it.</p>

<p><strong>So, how does GKE handle preemption?</strong> Will the node do a drain/cordon operation or does it just do a hard shutdown?</p>

<p><strong>More recent and relevant answer</strong></p>

<p>There's a GitHub project (not mine) that catches this ACPI handler and has the node cordon and drain itself, and then restart itself which in our tests results in a much cleaner preemptible experience, it's almost not noticeable with a highly available deployments on your cluster.</p>

<p>See: <a href="https://github.com/GoogleCloudPlatform/k8s-node-termination-handler" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/k8s-node-termination-handler</a></p>
