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

Point the old bootstrapping tutorial URL at new StatefulSet docs #1707

Merged
merged 5 commits into from
Dec 7, 2016
Merged

Point the old bootstrapping tutorial URL at new StatefulSet docs #1707

merged 5 commits into from
Dec 7, 2016

Conversation

janetkuo
Copy link
Member

@janetkuo janetkuo commented Nov 17, 2016

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

This change is Reviewable

@janetkuo janetkuo added this to the 1.5 milestone Nov 17, 2016
@janetkuo janetkuo self-assigned this Nov 17, 2016
@janetkuo janetkuo assigned erictune and unassigned janetkuo Nov 17, 2016
@@ -16,8 +16,8 @@ spec:
selector:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we fix terminationGracePeriod for these fixtures not to be zero?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@enisoc
Copy link
Member

enisoc commented Nov 18, 2016

Is the main purpose of this tutorial to teach users how to run a VM-like workload? Or is it to demonstrate StatefulSet patterns? If it's the latter, I think there will be a lot of overlap with #1722 which uses the same patterns, but for MySQL.

@janetkuo
Copy link
Member Author

@enisoc the main purpose of this tutorial is teaching users how Kubenetes + pods are different from VMs, based on http://kubernetes.io/docs/user-guide/petset/bootstrapping/, and deprecating the bootstrapping guide

@enisoc
Copy link
Member

enisoc commented Nov 18, 2016

OK in that case I'll try to minimize overlap in my tutorial.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 21, 2016

{% capture overview %}

This page helps you become familiar with the runtime initialization of [Stateful Sets](/docs/user-guide/petset).
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not necessarily new to this change, but the topic of this item is "VM-style workload" but nothing in the first 40 lines explains why that is. A sentence in the overview or objectives that explains how the title relates to what is being shown would be good.

@steveperry-53
Copy link
Contributor

I'm starting a writing review now.

@steveperry-53
Copy link
Contributor

See this commit for suggested changes.

@erictune erictune assigned enisoc and unassigned erictune Dec 2, 2016
@enisoc
Copy link
Member

enisoc commented Dec 2, 2016

Reviewed 7 of 8 files at r1, 2 of 2 files at r2, 1 of 1 files at r5.
Review status: all files reviewed at latest revision, 10 unresolved discussions, some commit checks failed.


_data/tutorials.yml, line 56 at r5 (raw file):

- title: Stateful Applications
  section:
  - title: Running a VM-style workload using Stateful Set

Merge StatefulSet into one word in title and URL.


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 29 at r5 (raw file):

* Learn about the runtime initialization of StatefulSets.

* Run a VM-style workload by using a StatefulSet and a Kubernetes a feature called

Remove extra "a" before "feature".


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 51 at r5 (raw file):

* Your Kubernetes cluster must be running Kubernetes version 1.5 or later.

* Familiarize yourself with the terminology in

Add "the" at the end.


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 73 at r5 (raw file):

To further simulate a VM, a Pod needs a way to initialize its user environment
when the the Pod starts. Also, tools like `kubectl exec` must not be allowed to

Double "the".


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 84 at r5 (raw file):

Instead of guaranteeing that containers will not be restarted, Kubernetes provides
a way to ensure that when a container stops and restarts, all of of the state

Double "of".


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 201 at r5 (raw file):

In this portion of the tutorial, you create a StatefulSet of nginx servers, and
you make one of them a master. The other nginx servers will proxy requests to
the master. See

Add "the" at the end.


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 315 at r5 (raw file):

* Write the config to a `hostPath` volume shared with the parent StatefulSet.

**Important:** In practice all Pods should query their peers for the current

We should elaborate on why this is important, especially since my replicated MySQL tutorial does the opposite. The difference is in this case you're allowing the master to change dynamically, whereas mine requires that the master is always index 0.


docs/tutorials/stateful-application/vm-style-workload-using-stateful-set.md, line 323 at r5 (raw file):

{% capture whatsnext %}

* You can deploy some example StatefulSets found

TODO: Add a link to Replicated Stateful Application tutorial.


Comments from Reviewable

@enisoc
Copy link
Member

enisoc commented Dec 2, 2016

Review status: all files reviewed at latest revision, 11 unresolved discussions, some commit checks failed.


docs/tutorials/stateful-application/statefulset_vm.yaml, line 36 at r5 (raw file):

                    "/bin/sh",
                    "-c",
                    "for d in usr lib etc; do cp -vnpr /$d/* /${d}mnt; done;"

The overall script should somehow exit with a non-zero error code if the whole process didn't succeed. You don't want to run the real workload if the initialization was incomplete. In Bash you can just add set -e at the beginning of the script. I'm not sure if that's guaranteed to work in whatever /bin/sh refers to.

In general, this approach of trying to merge in potential changes from the image (with cp --no-clobber) after the PVC has been initialized once before is dangerous. Suppose you let everything initialize, then delete a conf.d file that contains default login credentials. A subsequent Pod restart will restore that file, creating a vulnerability. This example also doesn't account for /var being lost between Pod reschedulings, which can cause data loss and other unexpected behavior.

At the least, we should warn that you shouldn't actually do this; it's just a toy example to demonstrate some concepts. A step further would be to do nothing at all if the PVC has ever been initialized before. That would at least be safer, although it means you should never change the image.

Personally my recommendation is to drop this tutorial altogether for now. If there are still concepts we want to teach that aren't covered in other tutorials, we should start over and rethink how to present them in a less misleading way. I suspect I'm in the minority in that so I'll defer to the wisdom of the team.


Comments from Reviewable

@janetkuo
Copy link
Member Author

janetkuo commented Dec 5, 2016

from @enisoc: Personally my recommendation is to drop this tutorial altogether for now.

@erictune @foxish @kow3ns thoughts?

@enisoc
Copy link
Member

enisoc commented Dec 6, 2016

To summarize: we discussed this offline and agreed to remove the VM-style tutorial for now because our other new StatefulSet tutorials cover the important concepts with use cases that have clearer motivations.

This PR will be repurposed to just point the old bootstrapping tutorial URL at new StatefulSet docs.

@janetkuo janetkuo changed the title Add Tutorial: Running a VM-style workload using Stateful Set Point the old bootstrapping tutorial URL at new StatefulSet docs Dec 6, 2016
@janetkuo
Copy link
Member Author

janetkuo commented Dec 6, 2016

PR & title updated, PTAL

@foxish
Copy link
Contributor

foxish commented Dec 6, 2016

LGTM

@devin-donnelly
Copy link
Contributor

devin-donnelly commented Dec 6, 2016

@janetkuo, @enisoc, @foxish, @erictune, @kow3ns: I think we should absolutely add this note at the top of the documentation, but not delete the doc itself--it still applies to 1.4 users.

* This document has been deprecated. For information on working with StatefulSet, see the tutorial on [how to run replicated stateful applications](/docs/tutorials/stateful-application/run-replicated-stateful-application).
* Starting in Kubernetes version 1.5, PetSet has been renamed to [StatefulSet](/docs/concepts/abstractions/controllers/statefulsets). To use (or continue to use) PetSet in Kubernetes 1.5, you _must_ migrate your exsiting PetSets to StatefulSets. For information on working with StatefulSet, see the tutorial on [how to run replicated stateful applications](/docs/tutorials/stateful-application/run-replicated-stateful-application).

* __This document has been deprecated__, but can still apply if you're using Kubernetes version 1.4 or earlier.
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to say this document is deprecated but can still apply, then we need to keep the content of the document.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. I'm suggesting below that we do not actually delete the content.

@enisoc
Copy link
Member

enisoc commented Dec 6, 2016

@devin-donnelly I think it would make sense to keep the doc if it was helping 1.4 users to maintain existing PetSets (like if it was a Task page describing how to do a manual rolling update), but to me the point of this particular doc is encouraging users to adopt PetSet for new use cases. Since PetSet is deprecated, our plan was to discourage against creating new PetSets and instead recommend upgrading to 1.5+ and using StatefulSets.

@devin-donnelly
Copy link
Contributor

@enisoc I understand. The only users I feel like we might miss are those that don't want to risk upgrading off 1.4 but still want to use PetSet (despite it being Alpha). I don't know if there are a lot of those users out there; any insight?

@devin-donnelly
Copy link
Contributor

@enisoc After a close reading, I strike my objection. Is there existing documentation that's a more basic "PetSet Guide" that needs to be marked as deprecated, however?

@steveperry-53
Copy link
Contributor

@janetkuo Would you like to squash commits before we merge this?

@enisoc
Copy link
Member

enisoc commented Dec 6, 2016

@devin-donnelly Yeah I think user-guide/petset fits your description for the basic guide that should probably be kept with just a deprecation warning at the top.

---

* TOC
{:toc}
Starting in Kubernetes version 1.5, PetSet has been renamed to [StatefulSet](/docs/concepts/abstractions/controllers/statefulsets). To use (or continue to use) PetSet in Kubernetes 1.5, you _must_ migrate your exsiting PetSets to StatefulSets. For information on working with StatefulSet, see the tutorial on [how to run replicated stateful applications](/docs/tutorials/stateful-application/run-replicated-stateful-application).
Copy link
Member

Choose a reason for hiding this comment

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

existing*

Copy link
Member

Choose a reason for hiding this comment

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

And should we link "migrate ..." directly to the PetSet upgrade task?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done and done.

@enisoc
Copy link
Member

enisoc commented Dec 6, 2016

I didn't see a PR yet for the above so created #1874

@devin-donnelly
Copy link
Contributor

I'll go ahead and merge this.

@devin-donnelly devin-donnelly merged commit d39d03c into kubernetes:release-1.5 Dec 7, 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.

10 participants