You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/concepts/workloads/controllers/deployment.md
+7-17
Original file line number
Diff line number
Diff line change
@@ -288,6 +288,9 @@ It is generally discouraged to make label selector updates and it is suggested t
288
288
In any case, if you need to perform a label selector update, exercise great caution and make sure you have grasped
289
289
all of the implications.
290
290
291
+
**Note:** In API version `apps/v1beta2`, a Deployment's label selector is immutable after it gets created.
292
+
{: .note}
293
+
291
294
* Selector additions require the pod template labels in the Deployment spec to be updated with the new label too,
292
295
otherwise a validation error is returned. This change is a non-overlapping one, meaning that the new selector does
293
296
not select ReplicaSets and Pods created with the old selector, resulting in orphaning all old ReplicaSets and
@@ -850,9 +853,9 @@ allowed, which is the default if not specified.
850
853
`.spec.selector` is an optional field that specifies a [label selector](/docs/concepts/overview/working-with-objects/labels/)
851
854
for the Pods targeted by this deployment.
852
855
853
-
If specified, `.spec.selector` must match `.spec.template.metadata.labels`, or it will be rejected by
854
-
the API. If `.spec.selector` is unspecified, `.spec.selector.matchLabels` defaults to
855
-
`.spec.template.metadata.labels`.
856
+
`.spec.selector` must match `.spec.template.metadata.labels`, or it will be rejected by the API.
857
+
858
+
In API version `apps/v1beta2`, `.spec.selector` and `.metadata.labels` no longer default to `.spec.template.metadata.labels` if not set. So they must be set explicitly. Also note that `.spec.selector` is immutable after creation of the Deployment in `apps/v1beta2`.
856
859
857
860
A Deployment may terminate Pods whose labels match the selector if their template is different
858
861
from `.spec.template` or if the total number of such Pods exceeds `.spec.replicas`. It brings up new
@@ -926,20 +929,7 @@ a Pod is considered ready, see [Container Probes](/docs/concepts/workloads/pods/
926
929
927
930
### Rollback To
928
931
929
-
`.spec.rollbackTo` is an optional field with the configuration the Deployment
930
-
should roll back to. Setting this field triggers a rollback, and this field will
931
-
be cleared by the server after a rollback is done.
932
-
933
-
Because this field will be cleared by the server, it should not be used
934
-
declaratively. For example, you should not perform `kubectl apply` with a
935
-
manifest with `.spec.rollbackTo` field set.
936
-
937
-
#### Revision
938
-
939
-
`.spec.rollbackTo.revision` is an optional field specifying the revision to roll
940
-
back to. Setting to 0 means rolling back to the last revision in history;
941
-
otherwise, means rolling back to the specified revision. This defaults to 0 when
942
-
[`spec.rollbackTo`](#rollback-to) is set.
932
+
Field `.spec.rollbackTo` has been deprecated in API versions `extensions/v1beta1` and `apps/v1beta1`, and is no longer supported in API version `apps/v1beta2`. Instead, `kubectl rollout undo` as introduced in [Rolling Back to a Previous Revision](#rolling-back-to-a-previous-revision) should be used.
0 commit comments