5
5
[id="deployments-comparing-deploymentconfigs-{context}"]
6
6
= Comparing Deployments and DeploymentConfigs
7
7
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.
27
35
28
36
[id="delpoymentconfigs-specific-features-{context}"]
29
37
== DeploymentConfigs-specific features
@@ -45,46 +53,30 @@ If you do not want new rollouts on pod template changes, pause the deployment:
45
53
$ oc rollout pause deployments/<name>
46
54
----
47
55
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
-
54
56
[discrete]
55
57
==== Lifecycle hooks
56
58
57
- Deployments do not support any lifecycle hooks.
59
+ Deployments do not yet support any lifecycle hooks.
58
60
59
61
[discrete]
60
62
==== Custom strategies
61
63
62
- Deployments do not yet support user-specified Custom deployment
64
+ Deployments do not support user-specified Custom deployment
63
65
strategies yet.
64
66
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
-
75
67
[id="delpoyments-specific-features-{context}"]
76
68
== Deployments-specific features
77
69
78
70
[discrete]
79
71
==== Rollover
80
72
81
73
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
83
75
new rollout. This means that a Deployment can have as many active
84
76
ReplicaSets as possible, and eventually the deployment controller will scale
85
77
down all old ReplicaSets and scale up the newest one.
86
78
87
- Deployment configurations can have at most one deployer pod running, otherwise
79
+ DeploymentConfigs can have at most one deployer pod running, otherwise
88
80
multiple deployers end up conflicting while trying to scale up what they think
89
81
should be the newest ReplicationController. Because of this, only two
90
82
ReplicationControllers can be active at any point in time. Ultimately, this
@@ -94,19 +86,19 @@ translates to faster rapid rollouts for Deployments.
94
86
==== Proportional scaling
95
87
96
88
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
98
90
rollouts. Additional replicas are distributed proportionally based on the size
99
91
of each ReplicaSet.
100
92
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
103
95
process about the size of the new ReplicationController.
104
96
105
97
[discrete]
106
98
==== Pausing mid-rollout
107
99
108
100
Deployments can be paused at any point in time, meaning you can also
109
101
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
111
103
rollout, the deployer process will not be affected and will continue until it
112
104
finishes.
0 commit comments