<p>We can restart kubernetes deployment using kubectl rollout restart. I want to perform same action using kubernetes api server.</p>

<p>You can use this Curl to restart using the API</p>
<pre><code>curl --location --request PATCH 'http://&lt;K8s cluster IP&gt;:6443/apis/apps/v1/namespaces/&lt;Namespace name&gt;/deployments/&lt;Deployment name&gt;?fieldManager=kubectl-rollout&amp;pretty=true' \
--header 'Content-Type: application/strategic-merge-patch+json' \
--data-raw '{
    &quot;spec&quot;: {
        &quot;template&quot;: {
            &quot;metadata&quot;: {
                &quot;annotations&quot;: {
                    &quot;kubectl.kubernetes.io/restartedAt&quot;: &lt;time.Now()&gt;
                }
            }
        }
    }
}'
</code></pre>
<p>this will inject the annotation in deployment and restart the deployment.</p>
