-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamped concepts doc for ReplicaSet #5396
Conversation
Deploy preview ready! Built with commit 51a1507 https://deploy-preview-5396--kubernetes-io-master-staging.netlify.com |
/assign @kow3ns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments, but over all it looks awesome.
## ReplicaSet as an Horizontal Pod Autoscaler target | ||
## Writing a ReplicaSet Spec | ||
|
||
As with all other Kubernetes config, a ReplicaSet needs the `apiVersion`, `kind`, and `metadata` fields. For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:s/config/API objects/g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
## Writing a ReplicaSet Spec | ||
|
||
As with all other Kubernetes config, a ReplicaSet needs the `apiVersion`, `kind`, and `metadata` fields. For | ||
general information about working with config files, see [here](/docs/user-guide/simple-yaml/), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:s/config files/manifests/g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
For local container restarts, ReplicaSet delegate to an agent on the node, | ||
for example the [Kubelet](/docs/admin/kubelet/) or Docker. | ||
|
||
### Pod Selector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should consider adding a paragraph that indicates that, in Kuberentes 1.8 and later, selectors are no longer defaulted and are immutable after creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
between pods that it created or deleted and pods that another person or process created or | ||
deleted. This allows the ReplicaSet to be replaced without affecting the running pods. | ||
|
||
The `.spec.template.metadata.labels` must be equal to the `.spec.selector`, or it will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:s/must be equal to/must match/g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
be rejected by the API. | ||
|
||
Also you should not normally create any pods whose labels match this selector, either directly, with | ||
another ReplicaSet, or with another controller such as Job. If you do so, the ReplicaSet thinks that it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't call out Job here because of the way selectors work for Job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to Deployment.
@@ -118,6 +209,31 @@ Alternatively, you can use the `kubectl autoscale` command to accomplish the sam | |||
kubectl autoscale rs frontend | |||
``` | |||
|
|||
## Alternatives to ReplicaSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why StatefulSet is left out in this section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StatefulSet is for stateful applications that have very different requirements than those of stateless applications, which ReplicaSet and the alternatives can potentially handle.
/lgtm |
Reviewed 1 of 2 files at r1, 1 of 1 files at r2. Comments from Reviewable |
Replaced by #5463. Closing. |
This PR updated the concept doc for ReplicaSet. A few new sections were added, similarly to what the concepts docs for other workloads controllers have. This is a part of broader efforts to enhance the workloads controller docs. The corresponding example ReplicaSet YAML file was also updated to reflect the removal of selector defaulting for apps/v1beta2 in kubernetes/kubernetes#50164.
This change is