cci
更新StatefulSet
更新时间:2020/12/17 GMT+08:00
功能介绍
更新StatefulSet。
The following fields can be updated:
- metadata.labels
- metadata.annotations
- spec.replicas
- spec.template
- spec.restartPolicy
- spec.revisionHistoryLimit
- spec.progressDeadlineSeconds
The other fields cannot be updated.
URI
PATCH /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}
参数 |
描述 |
---|---|
namespace |
Object name and auth scope, such as for teams and projects. |
name |
Name of the StatefulSet. |
参数 |
是否必选 |
描述 |
---|---|---|
pretty |
No |
If 'true', then the output is pretty printed. |
请求消息
请求参数:
“Content-Type”消息头说明请参见PATCH请求方法操作说明。
请求示例:
将创建StatefulSet创建的StatefulSet的metadata.labels更新为"app": "statefulset-test2"。
Content-Type: application/merge-patch+json { "metadata": { "labels": { "app": "statefulset-test2" } } }
响应消息
响应参数:
响应参数的详细描述请参见表86。
响应示例:
{ "kind": "StatefulSet", "apiVersion": "apps/v1", "metadata": { "name": "statefulset-test", "namespace": "namespace-test", "selfLink": "/apis/apps/v1/namespaces/namespace-test/statefulsets/statefulset-test", "uid": "f4a35f35-b011-11e8-b6ef-f898ef6c78b4", "resourceVersion": "5231369", "generation": 2, "creationTimestamp": "2018-09-04T07:13:00Z", "labels": { "app": "statefulset-test2" }, "enable": true }, "spec": { "replicas": 2, "selector": { "matchLabels": { "app": "statefulset-test" } }, "template": { "metadata": { "creationTimestamp": null, "labels": { "app": "statefulset-test" }, "enable": true }, "spec": { "containers": [ { "name": "container-0", "image": "redis", "resources": { "limits": { "cpu": "500m", "memory": "1Gi" }, "requests": { "cpu": "500m", "memory": "1Gi" } }, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File", "imagePullPolicy": "IfNotPresent" } ], "restartPolicy": "Always", "terminationGracePeriodSeconds": 30, "dnsPolicy": "ClusterFirst", "securityContext": {}, "imagePullSecrets": [ { "name": "imagepull-secret" } ], "schedulerName": "default-scheduler" } }, "serviceName": "", "podManagementPolicy": "OrderedReady", "updateStrategy": { "type": "OnDelete" }, "revisionHistoryLimit": 10 }, "status": { "observedGeneration": 2, "replicas": 2, "updatedReplicas": 2, "currentRevision": "statefulset-test-f986b645b", "updateRevision": "statefulset-test-7748d5459", "collisionCount": 0 } }
父主题: StatefulSet
