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 a CockroachDB PetSet example #28446

Merged
merged 1 commit into from
Aug 20, 2016

Conversation

tbg
Copy link
Contributor

@tbg tbg commented Jul 4, 2016

The example starts a simple five-node cluster with otherwise
default settings (in particular, 3x replication).

cc @bprashanth


This change is Reviewable

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@tbg tbg force-pushed the example-petset-cockroachdb branch from 2cf8412 to a402b08 Compare July 4, 2016 03:11
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

1 similar comment
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

1 similar comment
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Jul 4, 2016
@bprashanth bprashanth assigned bprashanth and unassigned zmerlynn Jul 4, 2016

When all (or enough) nodes are up, simulate a failure like this:

```shell
Copy link
Contributor

Choose a reason for hiding this comment

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

please provide an example of how to set/get a key:value. An example displaying the replication properties would be nice too (i.e set in 1 read from 5), as would a scale up/down example (kubectl edit the petset and modify replicas to 6, does the new replica catch up to the cluster?). Is there a "master" we should avoid killing during upgrade?

Optionally, you could write something, bounce the whole cluster (delete pods --all), read the thing.
Also mentioning read/write throughput and how that scales with replicas will help.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I didn't go all out because bash isn't the right language for these tests (and we already have them elsewhere).
Also not too much about tradeoffs etc - I think for the toy example it's fine to assume that people generally have an idea of what they're toying with.

@bprashanth
Copy link
Contributor

@tschottdorf thanks! @kubernetes/examples @smarterclayton

@tbg
Copy link
Contributor Author

tbg commented Jul 4, 2016

Updated, PTAL.

@tbg tbg force-pushed the example-petset-cockroachdb branch 2 times, most recently from 9c62353 to 16fef39 Compare July 5, 2016 03:14
# We will need some version of `cockroach init` back for this to
# work. For now, just do the same in a shell snippet.
# Of course this isn't without danger - if node0 loses its data,
# it will upon restarting it will simply bootstrap a new cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

you have "it will" twice.

@bprashanth bprashanth added release-note-none Denotes a PR that doesn't merit a release note. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed release-note-label-needed labels Jul 27, 2016
@bprashanth
Copy link
Contributor

ok to test

@bprashanth
Copy link
Contributor

@tschottdorf thanks for the example. I've marked it lgtm with just one nit. If you get to it before it goes in, great, if not we can fix it with a follow up.

sorry for the delay, got sidetracked.

@tbg
Copy link
Contributor Author

tbg commented Jul 27, 2016

No worries, addressed your comment, rebased, and squashed.

On Wed, Jul 27, 2016 at 6:05 PM Prashanth B notifications@github.com
wrote:

@tschottdorf https://github.com/tschottdorf thanks for the example.
I've marked it lgtm with just one nit. If you get to it before it goes in,
great, if not we can fix it with a follow up.

sorry for the delay, got sidetracked.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#28446 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE135A_M89sLlyshpa0CIODxFiFGEa-vks5qZ9YsgaJpZM4JEBSZ
.

@bprashanth
Copy link
Contributor

Please run:
./hack/verify-boilerplate.sh
and do as directed, I think jenkins verification failed on it (copyright might need fixing)

@tbg
Copy link
Contributor Author

tbg commented Jul 27, 2016

Yep, thanks. Will fix.

@tbg tbg force-pushed the example-petset-cockroachdb branch from 8a55558 to 51ee5af Compare July 27, 2016 22:36
@tbg
Copy link
Contributor Author

tbg commented Jul 27, 2016

Done.

@bprashanth bprashanth added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jul 27, 2016
@k8s-github-robot k8s-github-robot added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. retest-not-required-docs-only and removed retest-not-required-docs-only labels Jul 28, 2016
@wojtek-t wojtek-t removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jul 31, 2016
@a-robinson
Copy link
Contributor

@bprashanth, I have a couple questions around what it would take to flesh this out a little more once @tschottdorf has time to fix the doc munger's complaints:

  1. Is there a good way to use secrets with petsets yet? Meaning if I have a certificate pre-created for each pet (i.e. cert-0, cert-1, etc.) and want the cert to end up with the pet that has the same index, is there a way to do that other than the pet manually grabbing it from the API when it starts up?
  2. If we want clients of cockroach to spread their load among the pets (which are symmetric from the clients' point of view), I assume we'd have to create a second service with a ClusterIP? My understanding is that the headless service just returns a list endpoints, so we'd be depending on clients to properly randomize their usage of them if we relied on just the headless service.

@bprashanth
Copy link
Contributor

  1. Secrets aren't a part of identity, we discussed it initially but there are other ways to distribute secrets (i.e generate something like a csr with your own hostname in the init container and hang on some pki service to sign it), and we don't autoprovision secrets like volumes so it's not something petset currently handles.
  2. The governing service is headless meaning it doesn't have clusterIP. You can lookup the name, and it'll return ips, the ordering of those ips will vary with the client (last I checked nslookup randomized, g's net.LookupHost didn't). If you want loadbalancing you need a service or ingress in front.

The example starts a simple five-node cluster with otherwise
default setting (in particular, 3x replication).
@tbg tbg force-pushed the example-petset-cockroachdb branch from 51ee5af to 6889f83 Compare August 18, 2016 20:00
@tbg
Copy link
Contributor Author

tbg commented Aug 18, 2016

Munged the docs and pushed.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 18, 2016
@bprashanth bprashanth added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 18, 2016
@k8s-bot
Copy link

k8s-bot commented Aug 19, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@bprashanth
Copy link
Contributor

ok to test

@k8s-bot
Copy link

k8s-bot commented Aug 19, 2016

GCE e2e build/test passed for commit 6889f83.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit e4730f7 into kubernetes:master Aug 20, 2016
k8s-github-robot pushed a commit that referenced this pull request Sep 10, 2016
Automatic merge from submit-queue

Productionize the cockroachdb example a little more

Includes:
* A service for clients to use
* Readiness/liveness probes
* An extended graceful termination period
* Automatic prometheus monitoring (when prometheus is configured to watch for annotations on services, as in [CoreOS's recent blog post](https://coreos.com/blog/prometheus-and-kubernetes-up-and-running.html), for example)

I'm leaving the management of certs to future work, but if anyone that sees this needs help with them in the meantime, don't hesitate to reach out.

Successor to #28446

@bprashanth - if you're still interested in / open to an e2e test (as mentioned in cockroachdb/cockroach#5967 (comment)), let me know and I'll put one together. If so, I assume you'd want it as part of the `petset` test group rather than the `examples` tests?

cc @tschottdorf 

**Release note**:
```release-note
NONE
```
@tbg tbg deleted the example-petset-cockroachdb branch October 6, 2016 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants