How to gracefully remove a node from Kubernetes?
<p>I want to scale up/down the number of machines to increase/decrease the number of nodes in my Kubernetes cluster. When I add one machine, I’m able to successfully register it with Kubernetes; therefore, a new node is created as expected. However, it is not clear to me how to smoothly shut down the machine later. A good workflow would be:</p>

<ol>
<li>Mark the node related to the machine that I am going to shut down as unschedulable;</li>
<li>Start the pod(s) that is running in the node in other node(s);</li>
<li>Gracefully delete the pod(s) that is running in the node;</li>
<li>Delete the node.</li>
</ol>

<p>If I understood correctly, even <code>kubectl drain</code> (<a href="https://groups.google.com/forum/#!topic/google-containers/FxOYvJp82T0" rel="noreferrer">discussion</a>) doesn't do what I expect since it doesn’t start the pods before deleting them (it relies on a replication controller to start the pods afterwards which may cause downtime). Am I missing something?</p>

<p>How should I properly shutdown a machine?</p>