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

StatefulSet should allow optional burst mode (don't wait for readiness) #39363

Closed
brendandburns opened this issue Jan 3, 2017 · 19 comments
Closed
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Milestone

Comments

@brendandburns
Copy link
Contributor

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):

Petset
DNS
StatefulSet

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Kubernetes version (use kubectl version): 1.5.1

Environment:

  • Cloud provider or hardware configuration: minikube 0.14.0
  • OS (e.g. from /etc/os-release): Debian

What happened:
DNS appears to not register host names for petset members (e.g. mongo-0.mongo...) until that Pod passes a readiness check.

This is problematic because you may want to configure everything to use that hostname (e.g. registering a replication participant with mong) prior to declaring that the cluster is ready.

Given that there is nothing about readiness in the DNS address (unlike a traditional Service) we
should register DNS before the Pod is "ready".

I suspect this is because we are re-using the standard endpoints controller here, we probably need
a special case for stateful set.

How to reproduce it (as minimally and precisely as possible):

Create a StatefulSet with a readiness delay of 20 seconds.
Exec into the pod and try to resolve the DNS address of the Pod
observe it fails.
Wait until the Pod is ready
observe it works.

Anything else do we need to know:
Nope

@bprashanth @smarterclayton

@brendandburns brendandburns changed the title PetSet DNS shouldn't wait for readiness StatefulSet/PetSet DNS shouldn't wait for readiness Jan 3, 2017
@hongchaodeng
Copy link
Contributor

Same as #39207. We encountered this problem for a while...

IMHO, this doesn't mean that we need to change readiness guarantee. But we need a special phase that isn't coupled to networking and we can use it to check service has been bootstrapped.

@smarterclayton
Copy link
Contributor

If you set the annotation for tolerate unready you should see DNS entries almost instantly. Can you double check that?

@hongchaodeng
Copy link
Contributor

hongchaodeng commented Jan 3, 2017

You mean this field?

TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"

Didn't realize it. Will give a try!

@resouer
Copy link
Contributor

resouer commented Jan 3, 2017

@smarterclayton What do you think about tolerate-unready-endpoint as default?

@bprashanth
Copy link
Contributor

@smarterclayton
Copy link
Contributor

smarterclayton commented Jan 4, 2017 via email

@kow3ns
Copy link
Member

kow3ns commented Jan 20, 2017

@hongchaodeng Can we close this issue as resolved?

@smarterclayton
Copy link
Contributor

There's been some discussion that for a subset of apps the SS controller should be able to fill out gaps more quickly - to not wait for readiness to continue. We'd need to clearly explain what the risks are for that:

  1. If you must form an initial quorum, and someone rescaled you quickly, your app would need to either only join with pod-0, or ignore additional joiners until initial quorum is filled (otherwise, high members could form a different quorum).
  2. The app must not assume that pods join in order, which is unlikely to be normal.

The benefit of such a change would be that for apps that can form stable quorums safely they can do so much more quickly. For instance, and etcd set of 3 with an env var EXPECT_INITIAL=3 could only allow 0-2 to join before 3+ joins. And could disallow 5-6 from joining until 3-4 check in. This would also allow readiness to be more effective (pod is ready once it joins quorum, instead of before).

This is something that would have to be opt in and may have implications for future update scenarios (we'd want to talk through that before adding anything beyond an alpha feature).

@kubernetes/sig-apps-feature-requests for additional opinions and comments. Was raised to be in the context of ES data nodes (which are non-voting) and AP stores which don't assume quorum is even possible (like infinispan). I'd be willing to endorse an alpha annotation that allows SS to proceed to create new pods in this fashion.

@smarterclayton smarterclayton self-assigned this Jan 29, 2017
@smarterclayton smarterclayton added sig/apps Categorizes an issue or PR as relevant to SIG Apps. kind/feature Categorizes issue or PR as related to a new feature. labels Jan 29, 2017
@smarterclayton smarterclayton added this to the 1.6 milestone Jan 29, 2017
@smarterclayton
Copy link
Contributor

(Im repurposing this since in spirit both outcomes described are desirable)

@erictune
Copy link
Member

@kow3ns

@smarterclayton
Copy link
Contributor

Relevant to #38418 - same problem as I described above in a different form.

@kow3ns
Copy link
Member

kow3ns commented Feb 2, 2017

@smarterclayton I think #38418 is somewhat separate, but I concur that we should allow an annotation that optimizes for burst roll outs.
I was thinking something like [statefulset.alpha.kubernetes.io/burst]= to allow up to sequential replicas to be concurrently unready simultaneously with [statefulset.alpha.kubernetes.io/burst]="all" being equivalent to =set.Spec.Replicas.
Where you thinking along these lines or did you have something else in mind?

@smarterclayton
Copy link
Contributor

Yeah, that works for me. We could consider "burst: majority" or a percentage to allow someone who isn't dependent on ordering to ensure that the controller will keep trying to fill the slots to achieve a majority even if the rate of evictions > rate of renewal. But burst=all would be the first knob to try probably.

@ethernetdan
Copy link
Contributor

Moving to 1.7 as late to happen in 1.6. Feel free to switch back if this is incorrect.

@ethernetdan ethernetdan modified the milestones: v1.7, v1.6 Mar 13, 2017
@0xmichalis 0xmichalis removed the kind/bug Categorizes issue or PR as related to a bug. label Mar 14, 2017
@tslater
Copy link

tslater commented Apr 24, 2017

@smarterclayton @hongchaodeng Just to clarify, service.alpha.kubernetes.io/tolerate-unready-endpoints is only for services, right? I'm using that on my headless service, but I'm not able to use it with my StatefulSet, right? There's no way to do that ahead of this bursting proposal, with the current api?

@smarterclayton
Copy link
Contributor

Correct. I was going to open a PR for the bursting if I get a chance in the next few days.

@tslater
Copy link

tslater commented Apr 24, 2017 via email

@enisoc enisoc changed the title StatefulSet/PetSet DNS shouldn't wait for readiness StatefulSet should allow optional burst mode (don't wait for readiness) Jun 9, 2017
@enisoc
Copy link
Member

enisoc commented Jun 9, 2017

The original purpose of this issue seems to be addressed by tolerate-unready-endpoints. I'm renaming it to reflect the shift in purpose since I don't see that discussion captured elsewhere.

@smarterclayton
Copy link
Contributor

Bursting was implemented in 1.7 in alpha and will be beta in 1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

No branches or pull requests