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

Add Task: Scaling Stateful Sets #1774

Merged
merged 3 commits into from
Dec 2, 2016
Merged

Add Task: Scaling Stateful Sets #1774

merged 3 commits into from
Dec 2, 2016

Conversation

janetkuo
Copy link
Member

@janetkuo janetkuo commented Nov 23, 2016

cc @bprashanth @erictune @foxish @kow3ns @enisoc @kubernetes/sig-apps


This change is Reviewable

@janetkuo janetkuo added this to the 1.5 milestone Nov 23, 2016
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 23, 2016
@janetkuo
Copy link
Member Author

The first commit is the common title for all new task docs for stateful set -- other PRs can include it to avoid dup works


### Use `kubectl` to scale Stateful Sets

#### `kubectl scale` (>= 1.4 release)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the client version? It's not clear if it is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this and suggested users to upgrade to >=1.5 kubectl


#### Scaling down doesn't not work right

You cannot scale down a Stateful Set when some of the stateful pods it manages are unhealthy. Scaling down only takes place
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/some/any/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


* Stateful Sets are only available in Kubernetes release >= 1.5.
* Stateful Sets are previously known as Pet Sets in Kubernetes release 1.3-1.4. You can either upgrade your Pet Sets to Stateful Sets,
or just change all `statefulset` references to `petset`. *TODO: link to upgrade from Pet Sets to Stateful Sets.*
Copy link
Contributor

@foxish foxish Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just change all statefulset references to petset

I think this is a little unclear.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to refer to past versions from the 1.5 docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all paragraphs about <1.5 clusters and petsets

kubectl scale statefulsets <stateful-set-name> --replicas=<new-replicas>
```

Note that `kubectl scale` only works on Stateful Set with Kubernetes release >= 1.4.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to assert this, since Stateful Sets don't exist in older releases anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubectl scale works for Pet Sets in 1.4. Not sure how to handle the wording StatefulSets/PetSets without being too verbose

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need to have Pet Set instructions at this point? I think removing all references to Pet Sets, and just explaining Stateful Sets would be cleaner. Also, isn't the old documentation for Pet Set going to be there anyway?

Copy link
Member Author

@janetkuo janetkuo Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the old documentation for Pet Set going to be there anyway?

The current doc plan is to deprecate the old user-guide for PetSets and link to StatefulSet concept guide there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devin-donnelly When we release 1.5 docs are we going to make the 1.4 docs available at kubernetes.io/1.4? We used to do that, but it doesn't work anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed 1.4 stuffs

@enisoc
Copy link
Member

enisoc commented Nov 23, 2016

Review status: 0 of 3 files reviewed at latest revision, 6 unresolved discussions.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 22 at r1 (raw file):

* Stateful Sets are previously known as Pet Sets in Kubernetes release 1.3-1.4. You can either upgrade your Pet Sets to Stateful Sets, 
or just change all `statefulset` references to `petset`. *TODO: link to upgrade from Pet Sets to Stateful Sets.*
* **Not all stateful applications scale nicely.** You need to understand your Stateful Sets well before continue. If you're unsure, remember that it may not be safe to scale your Stateful Sets. 

"before continuing" or "before you continue"


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 38 at r1 (raw file):

If you wish to change the number of replicas of your Stateful Set, just use this command:

I think you can delete "if you wish" and "just" to be more direct.


Comments from Reviewable

* Stateful Sets are only available in Kubernetes release >= 1.5.
* Stateful Sets are previously known as Pet Sets in Kubernetes release 1.3-1.4. You can either upgrade your Pet Sets to Stateful Sets,
or just change all `statefulset` references to `petset`. *TODO: link to upgrade from Pet Sets to Stateful Sets.*
* **Not all stateful applications scale nicely.** You need to understand your Stateful Sets well before continue. If you're unsure, remember that it may not be safe to scale your Stateful Sets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before you continue or before continu ing.

#### Scaling down doesn't not work right

You cannot scale down a Stateful Set when some of the stateful pods it manages are unhealthy. Scaling down only takes place
after those stateful pods become running and ready. See discussions [here](https://github.com/kubernetes/kubernetes/issues/36333).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy foxish's explanation verbatim here rather than linking to issue/

Copy link
Member

@erictune erictune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Couple of questions and one missing word.

@janetkuo
Copy link
Member Author

Review status: 0 of 3 files reviewed at latest revision, 8 unresolved discussions.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 22 at r1 (raw file):

Previously, enisoc (Anthony Yeh) wrote…

"before continuing" or "before you continue"

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 22 at r1 (raw file):

Previously, erictune (Eric Tune) wrote…

before you continue or before continu ing.

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 38 at r1 (raw file):

Previously, enisoc (Anthony Yeh) wrote…

I think you can delete "if you wish" and "just" to be more direct.

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 74 at r1 (raw file):

Previously, erictune (Eric Tune) wrote…

Copy foxish's explanation verbatim here rather than linking to issue/

Done.


Comments from Reviewable


With a StatefulSet of size > 1, if there is an unhealthy Pod, there is no way
for Kubernetes to know (yet) if it is due to a permanent fault or a transient
one (upgrade/maintenance/node reboot). If it were a permanent fault, scaling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"If it were a" -> "If the pod is unhealthy due to a permanent fault"

With a StatefulSet of size > 1, if there is an unhealthy Pod, there is no way
for Kubernetes to know (yet) if it is due to a permanent fault or a transient
one (upgrade/maintenance/node reboot). If it were a permanent fault, scaling
without paying heed to it may lead to a state where the StatefulSet membership
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"without paying heed to it" -> "without correcting the fault"

one (upgrade/maintenance/node reboot). If it were a permanent fault, scaling
without paying heed to it may lead to a state where the StatefulSet membership
drops below a certain minimum number of "replicas" that are needed to function
correctly, leading to unavailability (or worse).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End the sentence after "correctly". Second sentence: "This may cause your StatefulSet to become unavailable."

If you keep "or worse", explain what "or worse" means; it's kind of ominous but unhelpful as is.

drops below a certain minimum number of "replicas" that are needed to function
correctly, leading to unavailability (or worse).

If it were a transient one and the Pod were coming back up shortly, you won't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"If it were a transient one and the Pod were coming back up shortly" -> "If the pod is unhealthy due to a transient fault and the Pod might become available again,"

correctly, leading to unavailability (or worse).

If it were a transient one and the Pod were coming back up shortly, you won't
want that to interleave with your scale-up/scale-down operation. Some distributed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the transient error may interfere with your scale-up/scale-down operation."

@janetkuo
Copy link
Member Author

janetkuo commented Dec 2, 2016

Review status: 0 of 3 files reviewed at latest revision, 13 unresolved discussions.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 80 at r2 (raw file):

Previously, devin-donnelly wrote…

"If it were a" -> "If the pod is unhealthy due to a permanent fault"

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 81 at r2 (raw file):

Previously, devin-donnelly wrote…

"without paying heed to it" -> "without correcting the fault"

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 83 at r2 (raw file):

Previously, devin-donnelly wrote…

End the sentence after "correctly". Second sentence: "This may cause your StatefulSet to become unavailable."

If you keep "or worse", explain what "or worse" means; it's kind of ominous but unhelpful as is.

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 85 at r2 (raw file):

Previously, devin-donnelly wrote…

"If it were a transient one and the Pod were coming back up shortly" -> "If the pod is unhealthy due to a transient fault and the Pod might become available again,"

Done.


docs/tasks/manage-stateful-set/scale-stateful-set.md, line 86 at r2 (raw file):

Previously, devin-donnelly wrote…

"the transient error may interfere with your scale-up/scale-down operation."

Done.


Comments from Reviewable

@devin-donnelly
Copy link
Contributor

Thanks! Merging now.

@devin-donnelly devin-donnelly merged commit 42e33c4 into kubernetes:release-1.5 Dec 2, 2016
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants