<p>I have started kubectl proxy from within my pods and am able to access kubernetes APIs. I have a need to restart my statefulset.</p>

<p>Using kubectl, I would done this:</p>

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

<p>However, I would like to do this using the REST APIs. For instance, I can delete my pods, using this:</p>

<pre><code>curl -XDELETE localhost:8080/api/v1/namespaces/default/pods
</code></pre>

<p>Is there any equivalent REST endpoint that I can use to rollout restart a statefulset?</p>

Santosh Kewat
<p>I run your command <code>kubectl rollout restart statefulset my-statefulset --v 10</code> and notice the output logs.</p>

<p>I figured out  <code>kubectl</code> makes a patch request when I apply above command. And I am able to do that patch request using <strong>curl</strong> like following</p>

<pre><code>curl -k --data '{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubrnetes.io/restartedAt":"'"$(date +%Y-%m-%dT%T%z)"'"}}}}}'\ 
    -XPATCH   -H "Accept: application/json, */*" -H "Content-Type: application/strategic-merge-patch+json"\
    localhost:8080/apis/apps/v1/namespaces/default/statefulsets/my-statefulset
</code></pre>
