<p>Cannot find how to do so in the docs. After draining the node with <code>--ignore-daemonsets --force</code> pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet are lost. How should I move such pods prior to issuing the drain command? I want to preserve the local data on these pods. </p>

R678
<p>A good practice is to always start a Pod as a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a> with <code>specs.replicas: 1</code>. It's very easy as the Deployment <code>specs.template</code> literally takes in your Pod <code>specs</code>, and quite convenient as the deployment will make sure your Pod is always running.</p>

<p>Then, assuming you'll only have 1 replica of your Pod, you can simply use a PersistentVolumeClaim and attach it to the pod as a volume, you do not need a StatefulSet in that case. Your data will be stored in the PVC, and whenever your Pod is moved over nodes for whatever reason it will reattach the volume automatically without loosing any data.</p>

<p>Now, if it's too late for you, and your Pod hasn't got a volume pointing to a PVC, you can still get ready to change that by implementing the Deployment/PVC approach, and manually copy data out of your current pod:</p>

<pre><code>kubectl cp theNamespace/thePod:/the/path /somewhere/on/your/local/computer
</code></pre>

<p>Before copying it back to the new pod:</p>

<pre><code>kubectl cp /somewhere/on/your/local/computer theNamespace/theNewPod:/the/path
</code></pre>

<p>This time, just make sure <code>/the/path</code> (to reuse the example above) is actually a Volume mapped to a PVC so you won't have to do that manually again!</p>
