Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

liyinan926
Copy link

@liyinan926 liyinan926 commented Sep 11, 2017

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 Reviewable

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 11, 2017
@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented Sep 11, 2017

Deploy preview ready!

Built with commit 51a1507

https://deploy-preview-5396--kubernetes-io-master-staging.netlify.com

@liyinan926
Copy link
Author

/assign @kow3ns

Copy link
Member

@kow3ns kow3ns left a 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
Copy link
Member

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

Copy link
Author

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/),
Copy link
Member

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

Copy link
Author

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
Copy link
Member

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.

Copy link
Author

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
Copy link
Member

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

Copy link
Author

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
Copy link
Member

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

Copy link
Author

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
Copy link
Contributor

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?

Copy link
Author

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.

@kow3ns
Copy link
Member

kow3ns commented Sep 13, 2017

/lgtm

@liyinan926
Copy link
Author

Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 6 unresolved discussions.


Comments from Reviewable

@liyinan926
Copy link
Author

Replaced by #5463. Closing.

@liyinan926 liyinan926 closed this Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants