// Automatically generated by 'openshift-apidocs-gen'. Do not edit.
:_mod-docs-content-type: ASSEMBLY
[id="deployment-apps-v1"]
= Deployment [apps/v1]
:toc: macro
:toc-title:

toc::[]


Description::
+
--
Deployment enables declarative updates for Pods and ReplicaSets.
--

Type::
  `object`



== Specification

[cols="1,1,1",options="header"]
|===
| Property | Type | Description

| `apiVersion`
| `string`
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

| `kind`
| `string`
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

| `metadata`
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-ObjectMeta[`ObjectMeta`]
| Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

| `spec`
| `object`
| DeploymentSpec is the specification of the desired behavior of the Deployment.

| `status`
| `object`
| DeploymentStatus is the most recently observed status of the Deployment.

|===
=== .spec
Description::
+
--
DeploymentSpec is the specification of the desired behavior of the Deployment.
--

Type::
  `object`

Required::
  - `selector`
  - `template`



[cols="1,1,1",options="header"]
|===
| Property | Type | Description

| `minReadySeconds`
| `integer`
| Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)

| `paused`
| `boolean`
| Indicates that the deployment is paused.

| `progressDeadlineSeconds`
| `integer`
| The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.

| `replicas`
| `integer`
| Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.

| `revisionHistoryLimit`
| `integer`
| The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.

| `selector`
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-LabelSelector[`LabelSelector`]
| Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.

| `strategy`
| `object`
| DeploymentStrategy describes how to replace existing pods with new ones.

| `template`
| xref:../objects/index.adoc#io-k8s-api-core-v1-PodTemplateSpec[`PodTemplateSpec`]
| Template describes the pods that will be created. The only allowed template.spec.restartPolicy value is "Always".

|===
=== .spec.strategy
Description::
+
--
DeploymentStrategy describes how to replace existing pods with new ones.
--

Type::
  `object`




[cols="1,1,1",options="header"]
|===
| Property | Type | Description

| `rollingUpdate`
| `object`
| Spec to control the desired behavior of rolling update.

| `type`
| `string`
| Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.

Possible enum values:
 - `"Recreate"` Kill all existing pods before creating new ones.
 - `"RollingUpdate"` Replace the old ReplicaSets by new one using rolling update i.e gradually scale down the old ReplicaSets and scale up the new one.

|===
=== .spec.strategy.rollingUpdate
Description::
+
--
Spec to control the desired behavior of rolling update.
--

Type::
  `object`




[cols="1,1,1",options="header"]
|===
| Property | Type | Description

| `maxSurge`
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-util-intstr-IntOrString[`IntOrString`]
| The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.

| `maxUnavailable`
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-util-intstr-IntOrString[`IntOrString`]
| The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.

|===
=== .status
Description::
+
--
DeploymentStatus is the most recently observed status of the Deployment.
--

Type::
  `object`




[cols="1,1,1",options="header"]
|===
| Property | Type | Description

| `availableReplicas`
| `integer`
| Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.

| `collisionCount`
| `integer`
| Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.

| `conditions`
| `array`
| Represents the latest available observations of a deployment's current state.

| `conditions[]`
| `object`
| DeploymentCondition describes the state of a deployment at a certain point.

| `observedGeneration`
| `integer`
| The generation observed by the deployment controller.

| `readyReplicas`
| `integer`
| Total number of non-terminating pods targeted by this Deployment with a Ready Condition.

| `replicas`
| `integer`
| Total number of non-terminating pods targeted by this deployment (their labels match the selector).

| `terminatingReplicas`
| `integer`
| Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.

This is a beta field and requires enabling DeploymentReplicaSetTerminatingReplicas feature (enabled by default).

| `unavailableReplicas`
| `integer`
| Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.

| `updatedReplicas`
| `integer`
| Total number of non-terminating pods targeted by this deployment that have the desired template spec.

|===
=== .status.conditions
Description::
+
--
Represents the latest available observations of a deployment's current state.
--

Type::
  `array`




=== .status.conditions[]
Description::
+
--
DeploymentCondition describes the state of a deployment at a certain point.
--

Type::
  `object`

Required::
  - `type`
  - `status`



[cols="1,1,1",options="header"]
|===
| Property | Type | Description

| `lastTransitionTime`
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-Time[`Time`]
| Last time the condition transitioned from one status to another.

| `lastUpdateTime`
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-Time[`Time`]
| The last time this condition was updated.

| `message`
| `string`
| A human readable message indicating details about the transition.

| `reason`
| `string`
| The reason for the condition's last transition.

| `status`
| `string`
| Status of the condition, one of True, False, Unknown.

| `type`
| `string`
| Type of deployment condition.

|===

== API endpoints

The following API endpoints are available:

* `/apis/apps/v1/deployments`
- `GET`: list or watch objects of kind Deployment
* `/apis/apps/v1/watch/deployments`
- `GET`: watch individual changes to a list of Deployment. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead.
* `/apis/apps/v1/namespaces/{namespace}/deployments`
- `DELETE`: delete collection of Deployment
- `GET`: list or watch objects of kind Deployment
- `POST`: create a Deployment
* `/apis/apps/v1/watch/namespaces/{namespace}/deployments`
- `GET`: watch individual changes to a list of Deployment. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead.
* `/apis/apps/v1/namespaces/{namespace}/deployments/{name}`
- `DELETE`: delete a Deployment
- `GET`: read the specified Deployment
- `PATCH`: partially update the specified Deployment
- `PUT`: replace the specified Deployment
* `/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}`
- `GET`: watch changes to an object of kind Deployment. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead, filtered to a single item with the &#x27;fieldSelector&#x27; parameter.
* `/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status`
- `GET`: read status of the specified Deployment
- `PATCH`: partially update status of the specified Deployment
- `PUT`: replace status of the specified Deployment


=== /apis/apps/v1/deployments



HTTP method::
  `GET`

Description::
  list or watch objects of kind Deployment


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-api-apps-v1-DeploymentList[`DeploymentList`] schema
| 401 - Unauthorized
| Empty
|===


=== /apis/apps/v1/watch/deployments



HTTP method::
  `GET`

Description::
  watch individual changes to a list of Deployment. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead.


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-WatchEvent[`WatchEvent`] schema
| 401 - Unauthorized
| Empty
|===


=== /apis/apps/v1/namespaces/{namespace}/deployments



HTTP method::
  `DELETE`

Description::
  delete collection of Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
|===


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-Status[`Status`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `GET`

Description::
  list or watch objects of kind Deployment




.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-api-apps-v1-DeploymentList[`DeploymentList`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `POST`

Description::
  create a Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
| `fieldValidation`
| `string`
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
|===

.Body parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `body`
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 
|===

.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 201 - Created
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 202 - Accepted
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===


=== /apis/apps/v1/watch/namespaces/{namespace}/deployments



HTTP method::
  `GET`

Description::
  watch individual changes to a list of Deployment. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead.


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-WatchEvent[`WatchEvent`] schema
| 401 - Unauthorized
| Empty
|===


=== /apis/apps/v1/namespaces/{namespace}/deployments/{name}

.Global path parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `name`
| `string`
| name of the Deployment
|===


HTTP method::
  `DELETE`

Description::
  delete a Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
|===


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-Status[`Status`] schema
| 202 - Accepted
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-Status[`Status`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `GET`

Description::
  read the specified Deployment


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `PATCH`

Description::
  partially update the specified Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
| `fieldValidation`
| `string`
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
|===


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 201 - Created
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `PUT`

Description::
  replace the specified Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
| `fieldValidation`
| `string`
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
|===

.Body parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `body`
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 
|===

.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 201 - Created
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===


=== /apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}

.Global path parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `name`
| `string`
| name of the Deployment
|===


HTTP method::
  `GET`

Description::
  watch changes to an object of kind Deployment. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead, filtered to a single item with the &#x27;fieldSelector&#x27; parameter.


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../objects/index.adoc#io-k8s-apimachinery-pkg-apis-meta-v1-WatchEvent[`WatchEvent`] schema
| 401 - Unauthorized
| Empty
|===


=== /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status

.Global path parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `name`
| `string`
| name of the Deployment
|===


HTTP method::
  `GET`

Description::
  read status of the specified Deployment


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `PATCH`

Description::
  partially update status of the specified Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
| `fieldValidation`
| `string`
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
|===


.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 201 - Created
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===

HTTP method::
  `PUT`

Description::
  replace status of the specified Deployment


.Query parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `dryRun`
| `string`
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
| `fieldValidation`
| `string`
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
|===

.Body parameters
[cols="1,1,2",options="header"]
|===
| Parameter | Type | Description
| `body`
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 
|===

.HTTP responses
[cols="1,1",options="header"]
|===
| HTTP code | Reponse body
| 200 - OK
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 201 - Created
| xref:../workloads_apis/deployment-apps-v1.adoc#deployment-apps-v1[`Deployment`] schema
| 401 - Unauthorized
| Empty
|===


