<p>I usually restart my applications by:</p>

<pre><code>kubectl scale deployment my-app --replicas=0
</code></pre>

<p>Followed by:</p>

<pre><code>kubectl scale deployment my-app --replicas=1
</code></pre>

<p>which works fine. I also have another running application but when I look at its replicaset I see:</p>

<pre><code>$ kubectl get rs
NAME                                        DESIRED   CURRENT   READY     AGE
another-app                                 2         2         2         2d
</code></pre>

<p>So to restart that correctly I would of course need to:</p>

<pre><code>kubectl scale deployment another-app --replicas=0
kubectl scale deployment another-app --replicas=2
</code></pre>

<p>But is there a better way to do this so I don't have to manually look at the repliasets before scaling/restarting my application (that might have <code>replicas &gt; 1</code>)?</p>

u123
<p>You can restart pods by using level</p>

<pre><code>kubectl delete pods -l name=myLabel
</code></pre>

<p>You can rolling restart of all pods for a deployments, so that you don't take the service down</p>

<pre><code>kubectl patch deployment your_deployment_name -p \
  "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"`date +'%s'`\"}}}}}"
</code></pre>

<p>And After kubernetes version 1.15 you can</p>

<pre><code>kubectl rollout restart deployment your_deployment_name
</code></pre>
