<p>How do you get around waiting on resources not yes created?</p>
<p>In script I get:</p>
<pre><code>kubectl wait --for=condition=ready --timeout=60s -n &lt;some namespace&gt; --all pods

error: no matching resources found
</code></pre>

<p>This is a community wiki answer posted for better visibility. Feel free to expand it.</p>
<p>As documented:</p>
<blockquote>
<p>Experimental: Wait for a specific condition on one or many resources.</p>
<p>The command takes multiple resources and waits until the specified
condition is seen in the Status field of every given resource.</p>
<p>Alternatively, the command can wait for the given set of resources to
be deleted by providing the &quot;delete&quot; keyword as the value to the --for
flag.</p>
<p>A successful message will be printed to stdout indicating when the
specified condition has been met. One can use -o option to change to
output destination.</p>
</blockquote>
<p>This command will not work for the resources that hasn't been created yet. @EmruzHossain has posted two valid points:</p>
<ul>
<li><p>Make sure you have provided a valid namespace.</p>
</li>
<li><p>First wait for the resource to get created. Probably a loop running <code>kubectl get</code> periodically. When the desired resource is found, break the loop. Then, run <code>kubectl wait</code> to wait for the resource to be ready.</p>
</li>
</ul>
<p>Also, there is this open thread: <a href="https://github.com/kubernetes/kubernetes/issues/83242" rel="nofollow noreferrer">kubectl wait for un-existed resource. #83242</a> which is still waiting (no pun intended) to be implemented.</p>
