Skip to content

Commit c10b633

Browse files
authored
Merge pull request #63036 from bergerhoffer/OCPBUGS-4543
OCPBUGS 4543: Prioritizing deployments over deployment configs
2 parents 5ccb524 + f94187b commit c10b633

File tree

5 files changed

+41
-34
lines changed

5 files changed

+41
-34
lines changed

applications/deployments/what-deployments-are.adoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ toc::[]
88

99
The `Deployment` and `DeploymentConfig` API objects in {product-title} provide two similar but different methods for fine-grained management over common user applications. They are composed of the following separate API objects:
1010

11-
* A `DeploymentConfig` or `Deployment` object, either of which describes the desired state of a particular component of the application as a pod template.
12-
* `DeploymentConfig` objects involve one or more _replication controllers_, which contain a point-in-time record of the state of a deployment as a pod template. Similarly, `Deployment` objects involve one or more _replica sets_, a successor of replication controllers.
11+
* A `Deployment` or `DeploymentConfig` object, either of which describes the desired state of a particular component of the application as a pod template.
12+
* `Deployment` objects involve one or more _replica sets_, which contain a point-in-time record of the state of a deployment as a pod template. Similarly, `DeploymentConfig` objects involve one or more _replication controllers_, which preceded replica sets.
1313
* One or more pods, which represent an instance of a particular version of an application.
1414
15+
Use `Deployment` objects unless you need a specific feature or behavior provided by `DeploymentConfig` objects.
16+
1517
////
1618
Update when converted:
1719
[role="_additional-resources"]
@@ -31,7 +33,7 @@ xref:../../dev_guide/pod_autoscaling.adoc#dev-guide-pod-autoscaling[autoscaling]
3133
3234
Deployments and deployment configs are enabled by the use of native Kubernetes API objects `ReplicaSet` and `ReplicationController`, respectively, as their building blocks.
3335
34-
Users do not have to manipulate replication controllers, replica sets, or pods owned by `DeploymentConfig` objects or deployments. The deployment systems ensure changes are propagated appropriately.
36+
Users do not have to manipulate replica sets, replication controllers, or pods owned by `Deployment` or `DeploymentConfig` objects. The deployment systems ensure changes are propagated appropriately.
3537
3638
[TIP]
3739
====
@@ -40,11 +42,12 @@ If the existing deployment strategies are not suited for your use case and you m
4042
4143
The following sections provide further details on these objects.
4244
43-
include::modules/deployments-replicationcontrollers.adoc[leveloffset=+2]
4445
include::modules/deployments-replicasets.adoc[leveloffset=+2]
46+
include::modules/deployments-replicationcontrollers.adoc[leveloffset=+2]
4547
46-
include::modules/deployments-deploymentconfigs.adoc[leveloffset=+1]
4748
include::modules/deployments-kube-deployments.adoc[leveloffset=+1]
49+
include::modules/deployments-deploymentconfigs.adoc[leveloffset=+1]
50+
4851
include::modules/deployments-comparing-deploymentconfigs.adoc[leveloffset=+1]
4952
////
5053
Update when converted:

modules/deployments-comparing-deploymentconfigs.adoc

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,28 @@ For `DeploymentConfig` objects, if a node running a deployer pod goes down, it w
1818

1919
However, deployment rollouts are driven from a controller manager. The controller manager runs in high availability mode on masters and uses leader election algorithms to value availability over consistency. During a failure it is possible for other masters to act on the same deployment at the same time, but this issue will be reconciled shortly after the failure occurs.
2020

21+
[id="delpoyments-specific-features_{context}"]
22+
== Deployment-specific features
23+
24+
[discrete]
25+
==== Rollover
26+
27+
The deployment process for `Deployment` objects is driven by a controller loop, in contrast to `DeploymentConfig` objects that use deployer pods for every new rollout. This means that the `Deployment` object can have as many active replica sets as possible, and eventually the deployment controller will scale down all old replica sets and scale up the newest one.
28+
29+
`DeploymentConfig` objects can have at most one deployer pod running, otherwise multiple deployers might conflict when trying to scale up what they think should be the newest replication controller. Because of this, only two replication controllers can be active at any point in time. Ultimately, this results in faster rapid rollouts for `Deployment` objects.
30+
31+
[discrete]
32+
==== Proportional scaling
33+
34+
Because the deployment controller is the sole source of truth for the sizes of new and old replica sets owned by a `Deployment` object, it can scale ongoing rollouts. Additional replicas are distributed proportionally based on the size of each replica set.
35+
36+
`DeploymentConfig` objects cannot be scaled when a rollout is ongoing because the controller will have issues with the deployer process about the size of the new replication controller.
37+
38+
[discrete]
39+
==== Pausing mid-rollout
40+
41+
Deployments can be paused at any point in time, meaning you can also pause ongoing rollouts. However, you currently cannot pause deployer pods; if you try to pause a deployment in the middle of a rollout, the deployer process is not affected and continues until it finishes.
42+
2143
[id="delpoymentconfigs-specific-features_{context}"]
2244
== DeploymentConfig object-specific features
2345

@@ -45,27 +67,4 @@ Deployments do not yet support any lifecycle hooks.
4567
[discrete]
4668
==== Custom strategies
4769

48-
Deployments do not support user-specified custom deployment strategies yet.
49-
50-
[id="delpoyments-specific-features_{context}"]
51-
== Deployment-specific features
52-
53-
[discrete]
54-
==== Rollover
55-
56-
The deployment process for `Deployment` objects is driven by a controller loop, in contrast to `DeploymentConfig` objects which use deployer pods for every new rollout. This means that the `Deployment` object can have as many active replica sets as possible, and eventually the deployment controller will scale down all old replica sets and scale up the newest one.
57-
58-
`DeploymentConfig` objects can have at most one deployer pod running, otherwise multiple deployers end up conflicting while trying to scale up what they think should be the newest replication controller. Because of this, only two replication controllers can be active at any point in time. Ultimately, this translates to faster rapid rollouts for `Deployment` objects.
59-
60-
[discrete]
61-
==== Proportional scaling
62-
63-
Because the deployment controller is the sole source of truth for the sizes of new and old replica sets owned by a `Deployment` object, it is able to scale ongoing rollouts. Additional replicas are distributed proportionally based on the size of each replica set.
64-
65-
`DeploymentConfig` objects cannot be scaled when a rollout is ongoing because the controller will end up having issues with the deployer process about the size of the new replication controller.
66-
67-
[discrete]
68-
==== Pausing mid-rollout
69-
70-
Deployments can be paused at any point in time, meaning you can also pause ongoing rollouts. On the other hand, you cannot pause deployer pods
71-
currently, so if you try to pause a deployment in the middle of a rollout, the deployer process will not be affected and will continue until it finishes.
70+
Deployments do not support user-specified custom deployment strategies.

modules/deployments-kube-deployments.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
[id="deployments-kube-deployments_{context}"]
66
= Deployments
77

8-
Kubernetes provides a first-class, native API object type in {product-title} called `Deployment`. `Deployment` objects serve as a descendant of the {product-title}-specific `DeploymentConfig` object.
9-
10-
Like `DeploymentConfig` objects, `Deployment` objects describe the desired state of a particular component of an application as a pod template. Deployments create replica sets, which orchestrate pod lifecycles.
8+
Kubernetes provides a first-class, native API object type in {product-title} called `Deployment`. `Deployment` objects describe the desired state of a particular component of an application as a pod template. Deployments create replica sets, which orchestrate pod lifecycles.
119

1210
For example, the following deployment definition creates a replica set to bring up one `hello-openshift` pod:
1311

modules/deployments-replicasets.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[id="deployments-repliasets_{context}"]
66
= Replica sets
77

8-
Similar to a replication controller, a `ReplicaSet` is a native Kubernetes API object that ensures a specified number of pod replicas are running at any given time. The difference between a replica set and a replication controller is that a replica set supports set-based selector requirements whereas a replication controller only supports equality-based selector requirements.
8+
A `ReplicaSet` is a native Kubernetes API object that ensures a specified number of pod replicas are running at any given time.
99

1010
[NOTE]
1111
====

modules/deployments-replicationcontrollers.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[id="deployments-replicationcontrollers_{context}"]
66
= Replication controllers
77

8-
A replication controller ensures that a specified number of replicas of a pod are running at all times. If pods exit or are deleted, the replication controller acts to instantiate more up to the defined number. Likewise, if there are more running than desired, it deletes as many as necessary to match the defined amount.
8+
Similar to a replica set, a replication controller ensures that a specified number of replicas of a pod are running at all times. If pods exit or are deleted, the replication controller instantiates more up to the defined number. Likewise, if there are more running than desired, it deletes as many as necessary to match the defined amount. The difference between a replica set and a replication controller is that a replica set supports set-based selector requirements whereas a replication controller only supports equality-based selector requirements.
99

1010
A replication controller configuration consists of:
1111

@@ -18,6 +18,13 @@ A selector is a set of labels assigned to the pods that are managed by the repli
1818
The replication controller does not perform auto-scaling based on load or traffic, as it does not track either. Rather, this requires its replica
1919
count to be adjusted by an external auto-scaler.
2020

21+
[NOTE]
22+
====
23+
Use a `DeploymentConfig` to create a replication controller instead of creating replication controllers directly.
24+
25+
If you require custom orchestration or do not require updates, use replica sets instead of replication controllers.
26+
====
27+
2128
The following is an example definition of a replication controller:
2229

2330
[source,yaml]

0 commit comments

Comments
 (0)