-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Conversation
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) |
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 this the client version? It's not clear if it is.
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.
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 |
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/some/any/
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.
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.* |
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 change all
statefulset
references topetset
I think this is a little unclear.
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 don't think we need to refer to past versions from the 1.5 docs.
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.
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. |
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.
Do we need to assert this, since Stateful Sets don't exist in older releases anyway.
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.
kubectl scale works for Pet Sets in 1.4. Not sure how to handle the wording StatefulSets/PetSets without being too verbose
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.
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?
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.
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.
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.
@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.
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.
Removed 1.4 stuffs
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):
"before continuing" or "before you continue" docs/tasks/manage-stateful-set/scale-stateful-set.md, line 38 at r1 (raw file):
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. |
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.
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). |
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.
Copy foxish's explanation verbatim here rather than linking to issue/
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.
Looks good overall. Couple of questions and one missing word.
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…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 22 at r1 (raw file): Previously, erictune (Eric Tune) wrote…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 38 at r1 (raw file): Previously, enisoc (Anthony Yeh) wrote…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 74 at r1 (raw file): Previously, erictune (Eric Tune) wrote…
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 |
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.
"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 |
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.
"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). |
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.
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 |
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.
"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 |
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.
"the transient error may interfere with your scale-up/scale-down operation."
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…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 81 at r2 (raw file): Previously, devin-donnelly wrote…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 83 at r2 (raw file): Previously, devin-donnelly wrote…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 85 at r2 (raw file): Previously, devin-donnelly wrote…
Done. docs/tasks/manage-stateful-set/scale-stateful-set.md, line 86 at r2 (raw file): Previously, devin-donnelly wrote…
Done. Comments from Reviewable |
Thanks! Merging now. |
cc @bprashanth @erictune @foxish @kow3ns @enisoc @kubernetes/sig-apps
This change is