<p>I know that <code>kubectl delete pod &lt;pod_name&gt;</code> will remove the pod and a new pod will be auto-created if it is managed by a deployment.</p>
<p>Just want to know if there's a way to make the recreation happen before removal? Just like rolling restart one single pod with surge.</p>

eval
<p>There is no easy way but there is a workaround, although it requires few steps that need to be done one by one and is not error prone but I'll just show it to you to see that this can be done but <strong>you probably should not do this</strong>.</p>
<p>Let's first create a test deployment:</p>
<pre><code>$ kubectl create deployment --image nginx ngx --replicas 3 --dry-run -oyaml &gt; depl
$ kubectl apply -f depl
deployment.apps/ngx created

$ kubectl get po
NAME                   READY   STATUS    RESTARTS   AGE
ngx-768fd5d6f5-bj5z4   1/1     Running   0          45s
ngx-768fd5d6f5-rt9p5   1/1     Running   0          45s
ngx-768fd5d6f5-w4bv7   1/1     Running   0          45s
</code></pre>
<p>scale the deployment one replica up:</p>
<pre><code>$ kubectl scale deployment --replicas 4 ngx
deployment.apps/ngx scaled
</code></pre>
<p>delete a deployment and replicaset with <code>--cascade=orphan</code> (it will remove deployment and replicaset but will leave the pods untouched):</p>
<pre><code>$ kubectl delete deployment ngx --cascade=orphan
deployment.apps &quot;ngx&quot; deleted

$ kubectl delete replicaset ngx-768fd5d6f5 --cascade=orphan
replicaset.apps &quot;ngx-768fd5d6f5&quot; deleted
</code></pre>
<p>delete a pod you want:</p>
<pre><code>$ kubectl get po
NAME                   READY   STATUS    RESTARTS   AGE
ngx-768fd5d6f5-bj5z4   1/1     Running   0          4m53s
ngx-768fd5d6f5-rt9p5   1/1     Running   0          4m53s
ngx-768fd5d6f5-t4jch   1/1     Running   0          3m23s
ngx-768fd5d6f5-w4bv7   1/1     Running   0          4m53s

$ kubectl delete po ngx-768fd5d6f5-t4jch
pod &quot;ngx-768fd5d6f5-t4jch&quot; deleted

$ kubectl get po
NAME                   READY   STATUS    RESTARTS   AGE
ngx-768fd5d6f5-bj5z4   1/1     Running   0          5m50s
ngx-768fd5d6f5-rt9p5   1/1     Running   0          5m50s
ngx-768fd5d6f5-w4bv7   1/1     Running   0          5m50s
</code></pre>
<p>Now restore the deployment:</p>
<pre><code>$ kubectl apply -f depl
deployment.apps/ngx created
</code></pre>
<p>newly created deployment will create a new replicaset that will inherit already existing pods.</p>
<p>As you see this can be done, but it requires more effort and some tricks. This can be useful sometimes but I'd not recommend including it in your CI/CD pipeline.</p>
