Skip to content

Commit

Permalink
Minor changes to call out specific versions for selector defaulting and
Browse files Browse the repository at this point in the history
immutability
  • Loading branch information
liyinan926 committed Sep 19, 2017
1 parent 3f58083 commit 185b81f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/workloads/controllers/frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2 # for versions before 1.6.0 use extensions/v1beta1
kind: ReplicaSet
metadata:
name: frontend
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/workloads/controllers/replicaset.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ deleted. This allows the ReplicaSet to be replaced without affecting the running
The `.spec.template.metadata.labels` must match the `.spec.selector`, or it will
be rejected by the API.

In Kubernetes 1.8 or later, `.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 in Kubernetes 1.8 or later.
In Kubernetes 1.8 the API version `apps/v1beta2` on the ReplicaSet kind is the current version and is enabled by default. The API version `extensions/v1beta1` is deprecated. 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 starting in API version `apps/v1beta2`.

Also you should not normally create any pods whose labels match this selector, either directly, with
another ReplicaSet, or with another controller such as Deployment. If you do so, the ReplicaSet thinks that it
Expand Down

0 comments on commit 185b81f

Please sign in to comment.