<p>I am currently building a CI/CD pipeline where I am trying to test a simple nginx deployment, the problem is when I run <code>kubectl apply -f ./nginx-demplyment.yaml</code> I only get the output that resources got created/updated.</p>
<p>In my use case I the first thing i get is:</p>
<pre class="lang-sh prettyprint-override"><code>deployment.apps/nginx1.14.2 created
service/my-service created
</code></pre>
<p>And this is the output of <code>kubectl get all</code> where pods <code>STATUS</code> says <strong>ContainerCreating</strong>:</p>
<p><a href="https://i.stack.imgur.com/uaJYU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uaJYU.png" alt="kubectl get all output" /></a></p>
<p>The problem is in my pipeline I want to run <code>curl</code> command to check if my nginx server is working properly once the image gets pulled and the pod STATUS is Running, but obviously if the image didn't get pulled yet curl will say connection refused because the container is not up yet.</p>
<p>How can I do that and is there a way to get the output of pulling images at least?</p>
<blockquote>
<p>the task runs the commands with &amp;&amp; so the curl gets executed right after kubectl.</p>
</blockquote>
<blockquote>
<p>Am working on a kind cluster with 3 control-plane nodes and 2 worker nodes.</p>
</blockquote>

<p>You can use <code>kubectl wait</code> to wait for the deployment to be in a certain condition. Another option (or possibly used in combination) is to retry curl until the request returns a 200. An example of kubectl wait for your nginx deployment to become ready:</p>
<pre><code>kubectl wait --for=condition=available deployment/nginx
</code></pre>
