- 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.
- I tried scaling up statefulset pods using
PUT /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale
- but it didn't work for me.
Even tried fetching the scale data of specified statefulset using
"GET /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale"
REQUEST : curl -s -k -H "Authorization: Bearer $TOKEN" -X GET https://kubernetes.default.svc:443/apis/apps/v1/namespaces/$Namespace/$Kind/$PodNamePrefix/scale
Gives an error :
"message": "statefulsets.apps "app-4x" is forbidden: User "system:serviceaccount::default" cannot get resource "statefulsets/scale" in API group "apps" in the namespace ""","reason": "Forbidden",
Reference : https://v1-14.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/
Can somebody help me with this?