Reading a Specified Deployment
Function
This API is used to read a specified Deployment in a namespace.
URI
GET /apis/apps/v1/namespaces/{namespace}/deployments/{name} (for clusters of v1.9 and later)
GET /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name} (for clusters of v1.15 and earlier)
Table 1 describes the parameters of this API.
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
namespace |
Yes |
Object name and auth scope, such as for teams and projects. |
|
name |
Yes |
Name of the Deployment. |
|
pretty |
No |
If 'true', then the output is pretty printed. |
|
exact |
No |
Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. |
|
export |
No |
Should this value be exported. Export strips fields that a user cannot specify. |
Request
N/A
Response
For the description about response parameters, see Table 2.
Example response:
{
"kind": "Deployment",
"apiVersion": "apps/v1beta1",
"metadata": {
"name": "deployment-example",
"namespace": "default",
"selfLink": "/apis/apps/v1beta1/namespaces/default/deployments/deployment-example",
"uid": "1b33145a-9c63-11e6-9c54-42010a800148",
"resourceVersion": "2064726",
"generation": 4,
"creationTimestamp": "2016-10-27T16:33:35Z",
"labels": {
"app": "nginx"
},
"annotations": {
"deployment.kubernetes.io/revision": "1"
}
},
"spec": {
"replicas": 3,
"selector": {
"matchLabels": {
"app": "nginx"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "nginx"
}
},
"spec": {
"containers": [
{
"name": "nginx",
"image": "nginx:1.10",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
}
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {}
}
},
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": 1,
"maxSurge": 1
}
}
},
"status": {
"observedGeneration": 4,
"replicas": 3,
"updatedReplicas": 3,
"availableReplicas": 3
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a deployment resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Deleting All Deployments
Next Article: Reading the Status of a Specified Deployment
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.