<p>Since Kubernetes does not implement a dependency between Containers, I was wondering whether there is an elegant way of checking whether another Container in the same Pod is ready.</p>

<p>I would assume the Downward API is necessary.
Maybe it could be done by embedding <code>kubectl</code> inside the container - but is there a easier way?</p>

abergmeier
<p>For now I ended up using a simple file existence check:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      containers:
      ...
      - name: former
        readinessProbe:
          exec:
            command:
            - /bin/sh
            - "-c"
            - /bin/sh /check_readiness.sh &amp;&amp; touch /foo/ready
        volumeMounts:
        - name: shared-data
          mountPath: /foo
        ...
      - name: latter
        command:
        - /bin/sh
        - "-c"
        - while [ ! -f /foo/ready ]; do sleep 1; done; /bar.sh
        volumeMounts:
        - name: shared-data
          mountPath: /foo
          readOnly: true
      ...
      volumes:
      - name: shared-data
        emptyDir: {}
</code></pre>
