title: Manage scaling of Statefulsets using Kubernetes API
body: <ul>
  <li>I want scale up my statefulset and want to initiate this scale up from inside the pod(container) using
  the Kubernetes API(http request) to the kubernetes rest server.</li>
  <li>I tried scaling up statefulset pods using</li>
  </ul>
  <blockquote>
  <p>PUT /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale</p>
  </blockquote>
  <ul>
  <li>but it didn't work for me.</li>
  </ul>
  <p>Even tried fetching the scale data of specified statefulset using</p>
  <blockquote>
  <p>&quot;GET /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale&quot;</p>
  </blockquote>
  <blockquote>
  <p>REQUEST : curl -s -k -H &quot;Authorization: Bearer $TOKEN&quot; -X GET <a href="https://kubernetes.default.svc:443/apis/apps/v1/namespaces/$Namespace/$Kind/$PodNamePrefix/scale" rel="nofollow noreferrer">https://kubernetes.default.svc:443/apis/apps/v1/namespaces/$Namespace/$Kind/$PodNamePrefix/scale</a></p>
  </blockquote>
  <p>Gives an error :</p>
  <ul>
  <li><p>&quot;message&quot;: &quot;statefulsets.apps &quot;app-4x&quot; is forbidden: User
  &quot;system:serviceaccount::default&quot; cannot get resource
  &quot;statefulsets/scale&quot; in API group &quot;apps&quot; in the namespace
  &quot;&quot;&quot;,&quot;reason&quot;: &quot;Forbidden&quot;,</p>
  </li>
  <li><p>Reference : <a href="https://v1-14.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/" rel="nofollow noreferrer">https://v1-14.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/</a></p>
  </li>
  </ul>
  <p>Can somebody help me with this?</p>