<p>I'm using the following command to check if the namespace is active</p>
<pre><code>kubectl wait --for=condition=items.status.phase=Active namespace/mynamespace --timeout=2s
</code></pre>
<p>This always returns &quot;error: timed out waiting for the condition on namespaces/mynamespace&quot; although the namespace is active.
Is there a correct way to wait for the namespace to be active?  This script is part of a job to check the namespace is active after a AKS cluster restart.</p>

Rajesh Kazhankodath
<p>To date <code>status</code> is not a recognized <code>condition</code>. Try:</p>
<p><code>while ! [ &quot;$(kubectl get ns &lt;change to your namespace&gt; -o jsonpath='{.status.phase}')&quot; == &quot;Active&quot; ]; do echo 'Waiting for namespace to come online. CTRL-C to exit.'; sleep 1; done</code></p>
