<p>I have a ruby on rails app on kubernetes.</p>

<p>Here's what I do</p>

<ol>
<li><p>kubernetes rolling-update <code>new_file</code></p></li>
<li><p>Kubernetes began to create new pods </p></li>
<li><p>When the new pods are ready, Kubernetes kills the old pod.</p></li>
</ol>

<p>However, although my new pod are in ready state, they are actually doing rails assets build/compressing. They aren't ready yet. How can I let kubernetes know that it's not ready yet? </p>

<p>This sounds like a prime example for a readiness probe: It tells Kubernetes to not take a pod into load balancing until a certain condition holds, often an HTTP endpoint that returns positively. Here's an example probe defined along a Deployment specification:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx
spec:
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
        readinessProbe:
          httpGet:
            path: /index.html
            port: 80
          initialDelaySeconds: 30    
          timeoutSeconds: 1
</code></pre>

<p>See the <a href="http://kubernetes.io/docs/user-guide/production-pods/#liveness-and-readiness-probes-aka-health-checks" rel="nofollow">user guide</a> for a starter and follow-up links contained.</p>
