Apply templates, some edits for style guide conformance (#4537)

* edit for template, style guide conformance

* fix whitespace errors

* fix template errors
This commit is contained in:
Jennifer Rondeau
2017-07-31 19:43:08 -04:00
committed by Andrew Chen
parent d32de1bedb
commit d27df547b2
3 changed files with 121 additions and 96 deletions
@@ -6,10 +6,7 @@ assignees:
title: Replica Sets
---
* TOC
{:toc}
## What is a ReplicaSet?
{% capture overview %}
ReplicaSet is the next-generation Replication Controller. The only difference
between a _ReplicaSet_ and a
@@ -18,6 +15,13 @@ the selector support. ReplicaSet supports the new set-based selector requirement
as described in the [labels user guide](/docs/user-guide/labels/#label-selectors)
whereas a Replication Controller only supports equality-based selector requirements.
{% endcapture %}
{% capture body %}
## How to use a ReplicaSet
Most [`kubectl`](/docs/user-guide/kubectl/) commands that support
Replication Controllers also support ReplicaSets. One exception is the
[`rolling-update`](/docs/user-guide/kubectl/{{page.version}}/#rolling-update) command. If
@@ -33,16 +37,16 @@ creation, deletion and updates. When you use Deployments you don't have to worry
about managing the ReplicaSets that they create. Deployments own and manage
their ReplicaSets.
## When to use a ReplicaSet?
## When to use a ReplicaSet
A ReplicaSet ensures that a specified number of pod replicas are running at any given
A ReplicaSet ensures that a specified number of pod replicas are running at any given
time. However, a Deployment is a higher-level concept that manages ReplicaSets and
provides declarative updates to pods along with a lot of other useful features.
Therefore, we recommend using Deployments instead of directly using ReplicaSets, unless
you require custom update orchestration or don't require updates at all.
This actually means that you may never need to manipulate ReplicaSet objects:
use directly a Deployment and define your application in the spec section.
use a Deployment instead, and define your application in the spec section.
## Example
@@ -79,8 +83,8 @@ frontend-qhloh 1/1 Running 0 1m
## ReplicaSet as an Horizontal Pod Autoscaler target
A ReplicaSet can also be a target for
[Horizontal Pod Autoscalers (HPA)](/docs/tasks/run-application/horizontal-pod-autoscale/),
i.e. a ReplicaSet can be auto-scaled by an HPA. Here is an example HPA targeting
[Horizontal Pod Autoscalers (HPA)](/docs/tasks/run-application/horizontal-pod-autoscale/). That is,
a ReplicaSet can be auto-scaled by an HPA. Here is an example HPA targeting
the ReplicaSet we created in the previous example.
{% include code.html language="yaml" file="hpa-rs.yaml" ghlink="/docs/concepts/workloads/controllers/hpa-rs.yaml" %}
@@ -94,9 +98,13 @@ of the replicated pods.
kubectl create -f hpa-rs.yaml
```
Alternatively, you can just use the `kubectl autoscale` command to accomplish the same
Alternatively, you can use the `kubectl autoscale` command to accomplish the same
(and it's easier!)
```shell
kubectl autoscale rs frontend
```
{% endcapture %}
{% include templates/concept.md %}