更新时间:2022-04-18 GMT+08:00
替换指定Namespace下的ReplicationController
功能介绍
该API用于替换指定Namespace下的ReplicationController对象。
其中以下字段支持更新:
- metadata.name
- metadata.namespace
- metadata.selfLink
- metadata.resourceVersion
- metadata.uid
- metadata.labels
- metadata.clusterName
- metadata.generateName
- metadata.annotations
- spec.replicas
- template.containers
- spec.restartPolicy
- spec.activeDeadlineSeconds
- metadata.deletionGracePeriodSeconds
请求消息
请求参数:
请求参数的详细描述请参见表1。
请求示例:
{ "apiVersion": "v1", "kind": "ReplicationController", "metadata": { "name": "frontend-controller" }, "spec": { "replicas": 2, "selector": { "app": "nginx" }, "template": { "metadata": { "labels": { "app": "nginx", "label1": "testexample" } }, "spec": { "containers": [ { "name": "redis", "image": "redis:latest", "ports": [ { "containerPort": 80 } ] } ] } } } }
响应消息
响应参数:
响应参数的详细描述请参见请求消息。
响应示例:
{ "kind": "ReplicationController", "apiVersion": "v1", "metadata": { "name": "frontend-controller", "namespace": "default", "selfLink": "/api/v1/namespaces/default/replicationcontrollers/frontend-controller", "uid": "cd4594b6-5d0b-11e6-aeb9-286ed488fafe", "resourceVersion": "3544", "generation": 4, "creationTimestamp": "2016-08-08T01:59:55Z", "labels": { "app": "nginx", "label1": "testexample" } }, "spec": { "replicas": 2, "selector": { "app": "nginx" }, "template": { "metadata": { "creationTimestamp": null, "labels": { "app": "nginx", "label1": "testexample" } }, "spec": { "containers": [ { "name": "redis", "image": "redis:latest", "ports": [ { "containerPort": 80, "protocol": "TCP" } ], "resources": {}, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "IfNotPresent" } ], "restartPolicy": "Always", "terminationGracePeriodSeconds": 30, "dnsPolicy": "ClusterFirst", "securityContext": {} } } }, "status": { "replicas": 2, "fullyLabe;edRelicas": 2, "observedGeneration": 1 } }
