cci
创建Deployment
更新时间:2020/12/17 GMT+08:00
URI
POST /apis/apps/v1/namespaces/{namespace}/deployments
参数 |
描述 |
---|---|
namespace |
Object name and auth scope, such as for teams and projects. |
参数 |
是否必选 |
描述 |
---|---|---|
pretty |
Yes |
If 'true', then the output is pretty printed. |
请求消息
请求参数:
请求参数如表79所示。
请求示例:
{ "apiVersion": "apps/v1", "kind": "Deployment", "metadata": { "name": "deployment-test" }, "spec": { "replicas": 1, "selector": { "matchLabels": { "app": "redis" } }, "template": { "metadata": { "labels": { "app": "redis" } }, "spec": { "containers": [ { "image": "redis", "name": "container-0", "resources": { "limits": { "cpu": "500m", "memory": "1024Mi" }, "requests": { "cpu": "500m", "memory": "1024Mi" } } } ], "imagePullSecrets": [ { "name": "imagepull-secret" } ], "priority": 0 } } } }
响应消息
响应参数:
响应参数如表79所示。
响应示例:
{ "kind": "Deployment", "apiVersion": "apps/v1", "metadata": { "name": "deployment-test", "namespace": "namespace-test", "selfLink": "/apis/apps/v1/namespaces/namespace-test/deployments/deployment-test", "uid": "777dce52-b186-11e8-8cb0-c81fbe371a17", "resourceVersion": "5630832", "generation": 1, "creationTimestamp": "2018-09-06T03:39:32Z", "labels": { "app": "redis" }, "enable": true }, "spec": { "replicas": 1, "priority": 0, "selector": { "matchLabels": { "app": "redis" } }, "template": { "metadata": { "creationTimestamp": null, "labels": { "app": "redis" }, "annotations": { "cri.cci.io/container-type": "secure-container" }, "enable": true }, "spec": { "containers": [ { "name": "container-0", "image": "redis", "resources": { "limits": { "cpu": "500m", "memory": "1Gi" }, "requests": { "memory": "1Gi", "cpu": "500m" } }, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File", "imagePullPolicy": "IfNotPresent" } ], "restartPolicy": "Always", "terminationGracePeriodSeconds": 30, "dnsPolicy": "ClusterFirst", "securityContext": {}, "imagePullSecrets": [ { "name": "imagepull-secret" } ], "schedulerName": "default-scheduler" } }, "strategy": { "type": "RollingUpdate", "rollingUpdate": { "maxUnavailable": "25%", "maxSurge": "25%" } }, "revisionHistoryLimit": 10, "progressDeadlineSeconds": 600 }, "status": {} }
父主题: Deployment
