-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
SS concept #1719
SS concept #1719
Conversation
StatefulSet referneces to Stateful Set and all PetSet references to Pet Set
moves statefulset.md into controllers update _data/concepts.yml to show a TOC based on the above
shortens intro in favor of another Components section
### Limitations | ||
* Stateful Set is a beta resource, not available in any Kubernetes release prior to 1.5. | ||
* As with all alpha/beta resources, it can be disabled through the `--runtime-config` option passed to the apiserver. | ||
* The only mutable field on a Stateful Set is `replicas` |
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.
We can change the PodTemplateSpec IIRC. Perhaps we should remove this assertion.
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.
We should.
* As with all alpha/beta resources, it can be disabled through the `--runtime-config` option passed to the apiserver. | ||
* The only mutable field on a Stateful Set is `replicas` | ||
* The storage for a given Pod must either be provisioned by a [Persistent Volume Provisioner](http://releases.k8s.io/{{page.githubbranch}}/examples/experimental/persistent-volume-provisioning/README.md) based on the requested `storage class`, or pre-provisioned by an admin. | ||
* Deleting and/or scaling a Stateful Set down will *not* delete the volumes associated with the Stateful Set. This is done to ensure safety first, your data is more valuable than an auto purge of all related Stateful Set resources. **Deleting the Persistent Volume Claims will result in a deletion of the associated volumes**. |
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.
Maybe mention that if we provision our PVs manually, it does not exhibit this behavior?
- metadata: | ||
name: www | ||
annotations: | ||
volume.alpha.kubernetes.io/storage-class: anything |
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.
volume.beta....
are created based on the `volumeClaimTemplates` field of the Stateful Set. In the | ||
example above, each Pod will receive a single persistent volume with a storage | ||
class of anything and 1 Gib of provisioned storage. When a Pod is (re)scheduled, | ||
its volume(s) are available on the node on which it is launched. Note that, the |
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.
volume(s) are available on the node
should probably be rephrased.
[Annotations](/docs/concepts/object-metadata/annotations/) | ||
|
||
* [Annotations](/docs/concepts/object-metadata/annotations/) | ||
* [Stateful Sets](/docs/concepts/controllers/statefulsets/) |
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.
Need to update this to reflect new nav
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'm not sure that I follow. The link works. This is the correct location of the asset. Did you mean something else?
* The volumeClaimTemplates, will provide stable storage using [Persistent Volumes](/docs/user-guide/volumes/) provisioned by a | ||
[Persistent Volume Provisioner](http://releases.k8s.io/{{page.githubbranch}}/examples/experimental/persistent-volume-provisioning/README.md). | ||
|
||
```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.
Use something like {% include code.html language="yaml" file="petset.yaml" ghlink="/docs/user-guide/petset.yaml" %}
instead. We may need to rename the file and/or move the file here also
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 annotations example includes its YAML inline. I did the same so that the concepts pages are uniform in how they present structural examples. I'm in favor of using inline for concepts because the include produces a copy to clipboard button, and I don't think we want users copying and pasting from the concepts. If the consensus is that we want to use includes, then we should update the annotations concept for consistency.
@@ -0,0 +1,163 @@ | |||
--- |
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.
Add assignees here, so we know when this doc has issues raised against it:
---
assignees:
- bprashanth
- enisoc
- erictune
- foxish
- janetkuo
- kow3ns
- smarterclayton
---
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.
Thanks for the list. We should have the same list of assignees in all StatefulSet docs
adds assignees clarifies stable storage description
Reviewed 2 of 3 files at r1, 1 of 1 files at r2. docs/concepts/index.md, line 10 at r1 (raw file):
|
docs/concepts/index.md, line 10 at r1 (raw file):
|
docs/concepts/controllers/statefulsets.md, line 32 at r1 (raw file):
|
docs/concepts/controllers/statefulsets.md, line 43 at r2 (raw file):
|
docs/concepts/controllers/statefulsets.md, line 90 at r1 (raw file):
|
Review status: all files reviewed at latest revision, 16 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 43 at r2 (raw file):
|
Removes deprecation from comment wrt PetSets Creates separate section in concepts/index.md for Controllers Fixes grammer "an integer" Removes claim about persistent storage being auto-deleted Clarifies stability Adds call out tick around attributes
docs/concepts/controllers/statefulsets.md, line 43 at r2 (raw file):
|
Review status: 1 of 3 files reviewed at latest revision, 16 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 32 at r1 (raw file):
|
Review status: 1 of 3 files reviewed at latest revision, 16 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 34 at r1 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> > guarantees > Actually I looked into my GCP account and it never deletes the volumes. This should be removed.docs/concepts/controllers/statefulsets.md, line 46 at r1 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> The annotations example includes its YAML inline. I did the same so that the concepts pages are uniform in how they present structural examples. I'm in favor of using inline for concepts because the include produces a copy to clipboard button, and I don't think we want users copying and pasting from the concepts. If the consensus is that we want to use includes, then we should update the annotations concept for consistency.docs/concepts/controllers/statefulsets.md, line 13 at r2 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> I'll just remove deprecateddocs/concepts/controllers/statefulsets.md, line 43 at r2 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> We could write an example if it is in the plan, but we need to pick one system that is simple and apply the general concept. I would also think that the scope of this would be a tutorial ... we don't have a kubectl update that will do this atomically.Comments from Reviewable |
Reviewed 2 of 2 files at r3. docs/concepts/index.md, line 10 at r1 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> https://github.com/kow3ns/kubernetes.github.io/blob/7aa8c5d2e6253739a2da144d933b9daa1804ec36/_data/concepts.yml#L10-L13 > It is already thereComments from Reviewable |
Review status: all files reviewed at latest revision, 10 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 90 at r1 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> Done.docs/concepts/controllers/statefulsets.md, line 18 at r2 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> Done.docs/concepts/controllers/statefulsets.md, line 144 at r2 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> I haven't found any direct documentation as to the difference between anything and default. I could make a guess based on what is in the documentation, but we should probably dig through the code for an answer.Comments from Reviewable |
Review status: all files reviewed at latest revision, 10 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 90 at r1 (raw file): Previously, enisoc (Anthony Yeh) wrote…> It turns out the behavior we want here only works with the "alpha" annotation. See https://github.com/kubernetes/kubernetes/issues/37239Comments from Reviewable |
Removes storage annotation
Review status: 2 of 3 files reviewed at latest revision, 10 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 90 at r1 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> For the concept I'm getting rid of the annotation altogether. Its not really relevant here. I'm going to keep it as alpha for the tutorial.docs/concepts/controllers/statefulsets.md, line 18 at r2 (raw file): Previously, enisoc (Anthony Yeh) wrote…> You removed one too many *that*s.docs/concepts/controllers/statefulsets.md, line 144 at r2 (raw file): Previously, enisoc (Anthony Yeh) wrote…> It turns out the value you give is irrelevant. All that matters is the existence of the alpha annotation.Comments from Reviewable |
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. couple comment.
In the above, by stable, we mean persistent across Pod (re) schedulings. | ||
As it is generally easier to manage, if an application doesn't require any of | ||
the above guarantees, and if it is feasible to do so, it should be deployed as | ||
a set of stateless replicas. |
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.
"such as with Deployment (link to Deployment docs)".
* The storage for a given Pod must either be provisioned by a [Persistent Volume Provisioner](http://releases.k8s.io/{{page.githubbranch}}/examples/experimental/persistent-volume-provisioning/README.md) based on the requested `storage class`, or pre-provisioned by an admin. | ||
* Deleting and/or scaling a Stateful Set down will *not* delete the volumes associated with the Stateful Set. This is done to ensure safety first, your data is more valuable than an auto purge of all related Stateful Set resources. | ||
* Stateful Sets currently require a [Headless Service](/docs/user-guide/services/#headless-services) to be responsible for the network identity of the Pods. The user is responsible for this Service. | ||
* Updating an existing Stateful Set is currently a manual process, meaning you either need to deploy a new Stateful Set with the new image version, or orphan Pods one by one, update their image, and join them back to the cluster. |
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.
Maybe just say: "Updating an existing Stateful Set is currently a manual process: the pod template cannot be updated.". Leave the explanation of how you might manually update for later.
* A [Headless Service](/docs/user-guide/services/#headless-services), named nginx, is used to control the network domain. | ||
* The Stateful Set, named web, has a Spec that indicates that 3 replicas of the nginx container will be launched in unique Pods. | ||
* The volumeClaimTemplates, will provide stable storage using [Persistent Volumes](/docs/user-guide/volumes/) provisioned by a | ||
[Persistent Volume Provisioner](http://releases.k8s.io/{{page.githubbranch}}/examples/experimental/persistent-volume-provisioning/README.md). |
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 already linked to Persistent Volume Provisioner above. Not needed here?
Review status: 2 of 3 files reviewed at latest revision, 14 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 153 at r4 (raw file):
As discussed offline, this item is misleading as currently worded. The actual behavior is: Before any Pod is created, all existing Pods must be Running and Ready. Comments from Reviewable |
Removes redundant hyperlinks Makes statement about updates limitation more terse
Reviewed 1 of 3 files at r1, 1 of 1 files at r4, 1 of 1 files at r5. docs/concepts/controllers/statefulsets.md, line 36 at r4 (raw file): Previously, erictune (Eric Tune) wrote…> "such as with Deployment (link to Deployment docs)".docs/concepts/controllers/statefulsets.md, line 44 at r4 (raw file): Previously, erictune (Eric Tune) wrote…> Maybe just say: "Updating an existing Stateful Set is currently a manual process: the pod template cannot be updated.". Leave the explanation of how you might manually update for later.docs/concepts/controllers/statefulsets.md, line 52 at r4 (raw file): Previously, erictune (Eric Tune) wrote…> You already linked to Persistent Volume Provisioner above. Not needed here?docs/concepts/controllers/statefulsets.md, line 153 at r4 (raw file): Previously, enisoc (Anthony Yeh) wrote…> As discussed offline, this item is misleading as currently worded. The actual behavior is: Before any Pod is created, all existing Pods must be Running and Ready. > > See: https://github.com/kubernetes/kubernetes/blob/1dfd64f4378ad9dd974bbfbef8e90127dce6aafe/pkg/controller/petset/pet.go#L128Comments from Reviewable |
Review status: all files reviewed at latest revision, 13 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 153 at r4 (raw file): Previously, kow3ns (Kenneth Owens) wrote…> This item is true. We will have to add an additional limitation with respect to potential deadlock due to petSyncers current implementation.Comments from Reviewable |
StatefulSet and Persistent Volume becomes PersistentVolume)
Reviewed 3 of 3 files at r6. Comments from Reviewable |
This is solid; I have some writerly comments to be addressed. Also, there is an "abstractions" directory under "concepts"; I'd like to nest "controllers" underneath there. This differentiates it from the "control-plane" stuff (which also has its own directory). |
|
||
{% capture overview %} | ||
**StatefulSets are a beta feature in 1.5. This feature replaces the | ||
Pet Sets feature from 1.4. Users of Pet Sets are referred to the 1.5 |
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.
Address the user directly.
"If you've been using PetSet in your cluster in version 1.4, see the Upgrade Guide for further information on how to upgrade existing Pet Sets to StatefulSets."
* Ordered, graceful deployment and scaling. | ||
* Ordered, graceful deletion and termination. | ||
|
||
In the above, by stable, we mean persistent across Pod (re) schedulings. |
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.
Avoid "we" constructs. Rephrase:
"Both the unique network identifiers and the persistent storage associated with a StatefulSet are "stable" in the sense that they are persistent across Pod scheduling or re-scheduling."
* Ordered, graceful deletion and termination. | ||
|
||
In the above, by stable, we mean persistent across Pod (re) schedulings. | ||
As it is generally easier to manage, if an application doesn't require any of |
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 an application doesn't require any stable identifiers or ordered deployment, deletion, or scaling, you should deploy your application with a controller that provides a set of stateless replicas. Such controllers, such as [Deployment] or [ReplicaSet], are generally easier to manage and may be better suited to your needs."
|
||
### Limitations | ||
* StatefulSet is a beta resource, not available in any Kubernetes release prior to 1.5. | ||
* As with all alpha/beta resources, it can be disabled through the `--runtime-config` option passed to the apiserver. |
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.
Avoid pronouns. "It" -> "StatefulSet".
Avoid passive voice. "It can be disabled" -> "You can disable StatefulSet through the --runtime-config
option that you pass to the Kubernetes apiserver."
* StatefulSet is a beta resource, not available in any Kubernetes release prior to 1.5. | ||
* As with all alpha/beta resources, it can be disabled through the `--runtime-config` option passed to the apiserver. | ||
* The storage for a given Pod must either be provisioned by a [PersistentVolume Provisioner](http://releases.k8s.io/{{page.githubbranch}}/examples/experimental/persistent-volume-provisioning/README.md) based on the requested `storage class`, or pre-provisioned by an admin. | ||
* Deleting and/or scaling a StatefulSet down will *not* delete the volumes associated with the StatefulSet. This is done to ensure safety first, your data is more valuable than an auto purge of all related StatefulSet resources. |
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.
"This is done to ensure data safety, which is generally more valuable than an automatic purge of all related StatefulSet resources."
stable network identity, and stable storage. The identity sticks to the Pod, | ||
regardless of which node it's (re) scheduled on. | ||
|
||
__Ordinal Index__ |
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 a heading?
__Ordinal Index__ | ||
|
||
For a StatefulSet with N replicas, each Pod in the StatefulSet will be | ||
assigned an integer ordinal, in the range [0,N), that is unique over the Set. |
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.
Trailing parenthesis should be a square bracket.
|
||
__Stable Network ID__ | ||
|
||
The hostname of a Pod in a StatefulSet is derived from the name of the |
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.
"Each Pod in a StatefulSet derives its hostname from the name of the StatefulSet and the ordinal of the Pod."
|
||
__Stable Storage__ | ||
|
||
[PersistentVolumes](/docs/user-guide/volumes/), one for each Volume Claim Template, |
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.
"Kubernetes creates one [PersistentVolume] for each Volume Claim Template, as specified in the StatefulSet's volumeClaimTemplates
field."
* [Annotations](/docs/concepts/object-metadata/annotations/) | ||
|
||
#### Controllers | ||
* [StatefulSets](/docs/concepts/controllers/statefulsets/) |
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.
There is an "abstractions" directory inside concepts that I'd like "controllers" to be nested under.
Review status: all files reviewed at latest revision, 22 unresolved discussions. docs/concepts/controllers/statefulsets.md, line 36 at r4 (raw file): Previously, kow3ns (Kenneth Owens) wrote…
Done. docs/concepts/controllers/statefulsets.md, line 109 at r6 (raw file): Previously, devin-donnelly wrote…
Yes docs/concepts/controllers/statefulsets.md, line 112 at r6 (raw file): Previously, devin-donnelly wrote…
No it should not [ indicates that the interval includes 0 Comments from Reviewable |
Reviewed 4 of 4 files at r7. docs/concepts/index.md, line 12 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 14 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 33 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 34 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 42 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 44 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 45 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 116 at r6 (raw file): Previously, devin-donnelly wrote…
Done. docs/concepts/controllers/statefulsets.md, line 142 at r6 (raw file): Previously, devin-donnelly wrote…
Done. Comments from Reviewable |
Awesome, @kow3ns . Thanks. Merging now. |
Adds statefulsets.md to concepts and updates the concepts index.md to contain Stateful Sets
This change is