<p>I am trying to create an automated pipeline that would run multiple pods one after another on a namespace. The current issue is, between runs I want to wait for a pod to be fully deleted before running the next. Are there any ways to check if a given pod is fully deleted?</p>

<p>Current script:</p>

<pre><code>kubectl delete -f pod.yaml
sleep 10
kubectl create -f pod.yaml
error when creating "pod.yaml": object is being deleted: pods "test-pod" already exists
</code></pre>

<p>You can do something like this:</p>

<pre><code>kubectl delete -f pod.yaml
until kubectl get pod &lt;pod-name&gt; 2&gt;&amp;1 &gt;/dev/null; do sleep 10; done
kubectl create -f pod.yaml
</code></pre>

<p>Basically, wait until <code>kubectl get pod &lt;pod-name&gt;</code> returns an error because it doesn't exist.</p>
