cci
更新StatefulSet
更新时间:2020/12/17 GMT+08:00
功能介绍
This API is used to replace a StatefulSet object under a specified Namespace.
The following fields can be updated:
- metadata.labels
- metadata.generateName
- metadata.annotations
- spec.replicas
- spec.template
- spec.restartPolicy
- spec.revisionHistoryLimit
- spec.progressDeadlineSeconds
请求消息
请求参数:
请求参数的详细描述请参见表2。
“Content-Type”消息头说明请参见PATCH请求方法操作说明。
请求示例:
Content-Type: application/merge-patch+json
{ "metadata": { "labels": { "app": "mysql-0" } } }
响应消息
响应参数:
响应参数的详细描述请参见表2。
响应示例:
{ "kind": "StatefulSet", "apiVersion": "apps/v1beta1", "metadata": { "name": "statefulset-test", "namespace": "8f6c39e7c269440c881bba2fc49586d6", "selfLink": "/apis/apps/v1beta1/namespaces/8f6c39e7c269440c881bba2fc49586d6/statefulsets/statefulset-test", "uid": "ee0ef0d0-2728-11e8-8930-84a9c46e8ca3", "resourceVersion": "4510963", "generation": 2, "creationTimestamp": "2018-03-14T01:42:18Z", "labels": { "app": "mysql-0", "appgroup": "" }, "annotations": { "description": "" }, "enable": true }, "spec": { "replicas": 2, "selector": { "matchLabels": { "app": "statefulset-test" } }, "template": { "metadata": { "creationTimestamp": null, "labels": { "app": "statefulset-test" }, "annotations": { "com.huawei.scheduler/container-type": "secure-container", "metrics.alpha.kubernetes.io/custom-endpoints": "[{api:'',path:'',port:'',names:''}]", "pod.alpha.kubernetes.io/initialized": "true" }, "enable": true }, "spec": { "containers": [ { "name": "container-0", "image": "mysql:latest", "resources": { "limits": { "cpu": "1", "memory": "2Gi" }, "requests": { "cpu": "1", "memory": "2Gi" } }, "lifecycle": {}, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File", "imagePullPolicy": "IfNotPresent" }, { "name": "container-1", "image": "nginx:latest", "resources": { "limits": { "cpu": "1", "memory": "2Gi" }, "requests": { "cpu": "1", "memory": "2Gi" } }, "lifecycle": {}, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File", "imagePullPolicy": "Always" } ], "restartPolicy": "Always", "terminationGracePeriodSeconds": 30, "dnsPolicy": "ClusterFirst", "securityContext": {}, "imagePullSecrets": [ { "name": "imagepull-secret" } ], "affinity": {}, "schedulerName": "default-scheduler" } }, "serviceName": "test", "podManagementPolicy": "OrderedReady", "updateStrategy": { "type": "RollingUpdate" }, "revisionHistoryLimit": 10 }, "status": { "observedGeneration": 2, "replicas": 1, "currentReplicas": 1, "currentRevision": "statefulset-test-2238135242", "updateRevision": "statefulset-test-4168075007" } }
父主题: Statefulset
