<p>I'm running a three node cluster on GCE. I want to drain one node and delete the underlying VM.</p>

<p>Documentation for kubectl <code>drain</code> command says:</p>

<p><code>Once it returns (without giving an error), you can power down the node (or equivalently, if on a cloud platform, delete the virtual machine backing the node)
</code></p>

<p>I execute the following commands:</p>

<ol>
<li><p>Get the nodes</p>

<pre><code>$ kl get nodes
NAME                                      STATUS    AGE
gke-jcluster-default-pool-9cc4e660-6q21   Ready     43m
gke-jcluster-default-pool-9cc4e660-rx9p   Ready     6m
gke-jcluster-default-pool-9cc4e660-xr4z   Ready     23h
</code></pre></li>
<li><p>Drain node <code>rx9p</code>.</p>

<pre><code>$ kl drain gke-jcluster-default-pool-9cc4e660-rx9p --force
node "gke-jcluster-default-pool-9cc4e660-rx9p" cordoned
WARNING: Deleting pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet: fluentd-cloud-logging-gke-jcluster-default-pool-9cc4e660-rx9p, kube-proxy-gke-jcluster-default-pool-9cc4e660-rx9p
node "gke-jcluster-default-pool-9cc4e660-rx9p" drained
</code></pre></li>
<li><p>Delete gcloud VM.</p>

<pre><code> $ gcloud compute instances delete gke-jcluster-default-pool-9cc4e660-rx9p
</code></pre></li>
<li><p>List VMs.</p>

<pre><code> $ gcloud compute instances list
</code></pre>

<p>In the result, I'm seeing the VM I deleted above - <code>rx9p</code>. If I do <code>kubectl get nodes</code>, I'm seeing the rx9p node too.</p></li>
</ol>

<p>What's going on? Something is restarting the VM I'm deleting? Do I have to wait for some timeout between the commands?</p>

<p>You are on the right track with draining the node first.</p>

<p>The nodes (compute instances) are part of a <a href="https://cloud.google.com/compute/docs/instance-groups/#managed_instance_groups" rel="noreferrer">managed instance group</a>. If you delete just them with the <code>gcloud compute instances delete</code> command the managed instance group will recreate them.</p>

<p>To delete one properly use this command (after you have drained it!):</p>

<pre><code>gcloud compute instance-groups managed delete-instances \
  gke-jcluster-default-pool-9cc4e660-grp \
  --instances=gke-jcluster-default-pool-9cc4e660-rx9p \
  --zone=...
</code></pre>
