<p>Basically, I need the database deployment to spin up before the API deployment. If the database isn't running, it throws an error in the API. </p>

<p>I've messed with the order in <code>artifacts:</code> and also in:</p>

<pre><code>deploy:
  kubectl:
    manifests:
      - manifests/ingress.yaml 
      - manifests/postgres.yaml      
      - manifests/client.yaml
      - manifests/api.yaml
</code></pre>

<p>But it doesn't seem to have any bearing on the order they startup.</p>

<p>The only thing I can think is that it is alphabetical. I used to not have an issue: the database would startup 49/50 before the api. Now it is about the opposite. The only thing I've changed is a new computer and  I renamed the <code>server</code> to <code>api</code> which puts it first alphabetically. </p>

<p>So two questions:</p>

<ol>
<li>How is the deployment order determined in Skaffold?</li>
<li>Is there a way to set the order?</li>
</ol>

<p>What I had to do was setup a <code>readinessProbe</code> (<code>livenessProbe</code> is optional, for continuous life check) in the <code>containers</code> section of the <code>*.yaml</code> files.</p>
<pre><code>          livenessProbe:
            tcpSocket:
              port: 5000
            initialDelaySeconds: 2
            periodSeconds: 2
          readinessProbe:
            tcpSocket:
              port: 5000
            initialDelaySeconds: 2
            periodSeconds: 2
</code></pre>
<p>This looks for Django to fail (i.e. can't connect to the database) and if it does it keeps trying to redeploy it until it doesn't. This was the only way that I could find.</p>
