Updating the Status of a Specified StatefulSet
Function
This API is used to update the status of a StatefulSet under a specified namespace.
URI
PATCH /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status (for clusters of v1.9 and later)
PATCH /apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status (for clusters of v1.15 and earlier)
Table 1 describes the parameters of this API.
Request
Request parameters:
For the description about the Content-Type field, see Patch Request Method Operation Description.
Example request:
Content-Type: application/json-patch+json
[
{
"op": "replace",
"path": "/status/replicas",
"value": 3
}
]
Response
Response parameters:
For the description about response parameters, see Table 2.
Example response:
{
"kind": "StatefulSet",
"apiVersion": "apps/v1beta1",
"metadata": {
"name": "numberlimit",
"generateName": "sz",
"namespace": "default",
"selfLink": "/apis/apps/v1beta1/namespaces/default/statefulsets/numberlimit/status",
"uid": "841f6be1-2a25-11e7-a2a3-fa163e3a4289",
"resourceVersion": "1399731",
"generation": 3,
"creationTimestamp": "2017-04-26T02:10:27Z",
"labels": {
"app": "mysql"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "mysql"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "mysql"
}
},
"spec": {
"containers": [
{
"name": "container01",
"image": "10.154.52.159:443/test/mongo:latest",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
}
],
"resources": {
"limits": {
"cpu": "99M"
},
"requests": {
"cpu": "300M"
}
},
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {}
}
},
"serviceName": "service-number"
},
"status": {
"replicas": 3
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a StatefulSet resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Updating a Specified StatefulSet
Next Article: DaemonSet
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.