Skip to content

Commit 51a1507

Browse files
committed
Addressed comments
1 parent 8759a87 commit 51a1507

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/concepts/workloads/controllers/replicaset.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use a Deployment instead, and define your application in the spec section.
5151

5252
{% include code.html language="yaml" file="frontend.yaml" ghlink="/docs/concepts/workloads/controllers/frontend.yaml" %}
5353

54-
Saving this config into `frontend.yaml` and submitting it to a Kubernetes cluster should
54+
Saving this manifest into `frontend.yaml` and submitting it to a Kubernetes cluster should
5555
create the defined ReplicaSet and the pods that it manages.
5656

5757
```shell
@@ -95,8 +95,8 @@ frontend-qhloh 1/1 Running 0 1m
9595

9696
## Writing a ReplicaSet Spec
9797

98-
As with all other Kubernetes config, a ReplicaSet needs the `apiVersion`, `kind`, and `metadata` fields. For
99-
general information about working with config files, see [here](/docs/user-guide/simple-yaml/),
98+
As with all other Kubernetes API objects, a ReplicaSet needs the `apiVersion`, `kind`, and `metadata` fields. For
99+
general information about working with manifests, see [here](/docs/user-guide/simple-yaml/),
100100
[here](/docs/user-guide/configuring-containers/), and [here](/docs/concepts/tools/kubectl/object-management-overview/).
101101

102102
A ReplicaSet also needs a [`.spec` section](https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status).
@@ -124,11 +124,13 @@ manages all the pods with labels that match the selector. It does not distinguis
124124
between pods that it created or deleted and pods that another person or process created or
125125
deleted. This allows the ReplicaSet to be replaced without affecting the running pods.
126126

127-
The `.spec.template.metadata.labels` must be equal to the `.spec.selector`, or it will
127+
The `.spec.template.metadata.labels` must match the `.spec.selector`, or it will
128128
be rejected by the API.
129129

130+
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.
131+
130132
Also you should not normally create any pods whose labels match this selector, either directly, with
131-
another ReplicaSet, or with another controller such as Job. If you do so, the ReplicaSet thinks that it
133+
another ReplicaSet, or with another controller such as Deployment. If you do so, the ReplicaSet thinks that it
132134
created the other pods. Kubernetes does not stop you from doing this.
133135

134136
If you do end up with multiple controllers that have overlapping selectors, you
@@ -192,7 +194,7 @@ the ReplicaSet we created in the previous example.
192194

193195
{% include code.html language="yaml" file="hpa-rs.yaml" ghlink="/docs/concepts/workloads/controllers/hpa-rs.yaml" %}
194196

195-
Saving this config into `hpa-rs.yaml` and submitting it to a Kubernetes cluster should
197+
Saving this manifest into `hpa-rs.yaml` and submitting it to a Kubernetes cluster should
196198
create the defined HPA that autoscales the target ReplicaSet depending on the CPU usage
197199
of the replicated pods.
198200

0 commit comments

Comments
 (0)