<p>Kubernetes 1.15 introduced the command</p>

<pre><code>kubectl rollout restart deployment my-deployment
</code></pre>

<p>Which would be the endpoint to call through the API?
For example if I want to scale a deployment I can call</p>

<pre><code>PATCH /apis/apps/v1/namespaces/my-namespace/deployments/my-deployment/scale
</code></pre>

Leandro Cofre
<p>If you dig around in the <code>kubectl</code> source you can eventually find <a href="https://github.com/kubernetes/kubectl/blob/release-1.16/pkg/polymorphichelpers/objectrestarter.go#L32" rel="nofollow noreferrer"><code>(k8s.io/kubectl/pkg/polymorphichelpers).defaultObjectRestarter</code></a>.  All that does is change an annotation:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
spec:
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/restartedAt: '2006-01-02T15:04:05Z'
</code></pre>
<p>Anything that changes a property of the embedded pod spec in the deployment object will cause a restart; there isn't a specific API call to do it.</p>
<p>The useful corollary to this is that, if your <code>kubectl</code> and cluster versions aren't in sync, you can use <code>kubectl rollout restart</code> in <code>kubectl</code> 1.14 against older clusters, since it doesn't actually depend on any changes in the Kubernetes API.</p>
