Skip to content

Commit 5d28727

Browse files
authored
Merge pull request #14168 from bergerhoffer/OSDOCS-317
OSDOCS-317: Clarifications for deployment and dc comparison
2 parents 65fc903 + ab3fa4b commit 5d28727

File tree

1 file changed

+35
-43
lines changed

1 file changed

+35
-43
lines changed

modules/deployments-comparing-deploymentconfigs.adoc

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,33 @@
55
[id="deployments-comparing-deploymentconfigs-{context}"]
66
= Comparing Deployments and DeploymentConfigs
77

8-
Because deployment configurations existed in {product-title} prior to
9-
deployments being added in Kubernetes 1.2, the latter object type naturally
10-
diverges slightly from the former. The long-term goal in {product-title} is to reach
11-
full feature parity in Deployments and switch to using them as a
12-
single object type that provides fine-grained management over applications.
13-
14-
Deployments are supported to ensure upstream projects and examples that use the
15-
new object type can run smoothly on {product-title}. Given the current feature
16-
set of Deployments, you might want to use them instead of deployment
17-
configurations in {product-title} if you do not plan to use any of the following
18-
in particular:
19-
20-
- Image streams
21-
- Lifecycle hooks
22-
- Custom deployment strategies
23-
24-
The following sections go into more details on the differences between the two
25-
object types to further help you decide when you might want to use Kubernetes
26-
deployments over deployment configurations.
8+
Both Kubernetes Deployments and {product-title}-provided
9+
DeploymentConfigs are supported in {product-title}; however, it is
10+
recommended to use Deployments unless you need a specific feature or behavior
11+
provided by DeploymentConfigs.
12+
13+
The following sections go into more detail on the differences between the two
14+
object types to further help you decide which type to use.
15+
16+
[id='deployments-design-{context}']
17+
== Design
18+
19+
One important difference between Deployments and DeploymentConfigs is the
20+
properties of the link:https://en.wikipedia.org/wiki/CAP_theorem[CAP theorem]
21+
that each design has chosen for the rollout process. DeploymentConfigs prefer
22+
consistency, whereas Deployments take availability over consistency.
23+
24+
For DeploymentConfigs, if a node running a deployer Pod goes down, it will
25+
not get replaced. The process waits until the node comes back online or is
26+
manually deleted. Manually deleting the node also deletes the corresponding Pod.
27+
This means that you can not delete the Pod to unstick the rollout, as the
28+
kubelet is responsible for deleting the associated Pod.
29+
30+
However, Deployments rollouts are driven from a controller manager. The
31+
controller manager runs in high availability mode on masters and uses leader
32+
election algorithms to value availability over consistency. During a failure it
33+
is possible for other masters to act on the same Deployment at the same time,
34+
but this issue will be reconciled shortly after the failure occurs.
2735

2836
[id="delpoymentconfigs-specific-features-{context}"]
2937
== DeploymentConfigs-specific features
@@ -45,46 +53,30 @@ If you do not want new rollouts on pod template changes, pause the deployment:
4553
$ oc rollout pause deployments/<name>
4654
----
4755

48-
Currently, Deployments do not support `ImageChange` triggers. A generic
49-
triggering mechanism has been proposed upstream, but it is unknown if and when
50-
it may be accepted. Eventually, a {product-title}-specific mechanism could be
51-
implemented to layer on top of Deployments, but it would be more desirable for
52-
it to exist as part of the Kubernetes core.
53-
5456
[discrete]
5557
==== Lifecycle hooks
5658

57-
Deployments do not support any lifecycle hooks.
59+
Deployments do not yet support any lifecycle hooks.
5860

5961
[discrete]
6062
==== Custom strategies
6163

62-
Deployments do not yet support user-specified Custom deployment
64+
Deployments do not support user-specified Custom deployment
6365
strategies yet.
6466

65-
[discrete]
66-
==== Canary deployments
67-
68-
Deployments do not yet run canaries as part of a new rollout.
69-
70-
[discrete]
71-
==== Test deployments
72-
73-
Deployments do not support running test tracks.
74-
7567
[id="delpoyments-specific-features-{context}"]
7668
== Deployments-specific features
7769

7870
[discrete]
7971
==== Rollover
8072

8173
The deployment process for Deployments is driven by a controller
82-
loop, in contrast to deployment configurations which use deployer pods for every
74+
loop, in contrast to DeploymentConfigs which use deployer pods for every
8375
new rollout. This means that a Deployment can have as many active
8476
ReplicaSets as possible, and eventually the deployment controller will scale
8577
down all old ReplicaSets and scale up the newest one.
8678

87-
Deployment configurations can have at most one deployer pod running, otherwise
79+
DeploymentConfigs can have at most one deployer pod running, otherwise
8880
multiple deployers end up conflicting while trying to scale up what they think
8981
should be the newest ReplicationController. Because of this, only two
9082
ReplicationControllers can be active at any point in time. Ultimately, this
@@ -94,19 +86,19 @@ translates to faster rapid rollouts for Deployments.
9486
==== Proportional scaling
9587

9688
Because the Deployment controller is the sole source of truth for the sizes of
97-
new and old ReplicaSets owned by a deployment, it is able to scale ongoing
89+
new and old ReplicaSets owned by a Deployment, it is able to scale ongoing
9890
rollouts. Additional replicas are distributed proportionally based on the size
9991
of each ReplicaSet.
10092

101-
Deployment configurations cannot be scaled when a rollout is ongoing because the
102-
deployment configuration controller will end up having issues with the deployer
93+
DeploymentConfigs cannot be scaled when a rollout is ongoing because the
94+
DeploymentConfig controller will end up having issues with the deployer
10395
process about the size of the new ReplicationController.
10496

10597
[discrete]
10698
==== Pausing mid-rollout
10799

108100
Deployments can be paused at any point in time, meaning you can also
109101
pause ongoing rollouts. On the other hand, you cannot pause deployer pods
110-
currently, so if you try to pause a deployment configuration in the middle of a
102+
currently, so if you try to pause a DeploymentConfig in the middle of a
111103
rollout, the deployer process will not be affected and will continue until it
112104
finishes.

0 commit comments

Comments
 (0)