<p>I have been reading about <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-readiness-probes" rel="nofollow noreferrer">liveness and readiness probes in kubernetes</a> and I would like to use them to check and see if a cluster has come alive.</p>

<p>The question is how to configure a readiness probe for an entire statefulset, and not an individual pod/container.</p>

<p>A simple HTTP check can be used to determine readiness, but the issue I'm running into is that the readinessCheck seems to apply to the container/pod and not to the set itself.</p>

<p>For the software I'm using, the HTTP endpoint doesn't come up until the cluster forms; meaning that each individual pod would fail the readinessCheck until all three are up and find one another.</p>

<p>The behavior I'm seeing in Kubernetes right now is that the first of 3 replicas is created, and Kubernetes does not even attempt to create replicas 2 and 3 until the first passes the readinessCheck, which never happens, because all three have to be up for it to have a chance to pass it.</p>

<p>You need to change <code>.spec.podManagementPolicy</code> for a <code>StatefulSet</code> from <code>OrderedReady</code> to <code>Parallel</code> policy. </p>

<p>This way K8S will start all your pods in parallel and won't wait for probes.</p>

<p>From <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#statefulsetspec-v1-apps" rel="nofollow noreferrer">documentation</a></p>

<blockquote>
  <p>podManagementPolicy controls how pods are created during initial scale
  up, when replacing pods on nodes, or when scaling down. The default
  policy is OrderedReady, where pods are created in increasing order
  (pod-0, then pod-1, etc) and the controller will wait until each pod
  is ready before continuing. When scaling down, the pods are removed in
  the opposite order. The alternative policy is Parallel which will
  create pods in parallel to match the desired scale without waiting,
  and on scale down will delete all pods at once.</p>
</blockquote>
