title: Wait for job/pod completion in Kubernetes or Google Container Engine
body: <p>What's the best way in script to wait for a job or pod to complete in Kubernetes or Google Container Engine?</p>
  
  <p>In particular, it would be better to be notified rather than polling for status in <code>kubectl</code>, but I'd be happy with a fairly efficient loop without any slips between the cracks. Essentially, I'd like the equivalent of a plain <code>docker run</code> since that blocks until command termination, but I don't want to use docker directly in this case.</p>
  
  <p>I looked at <a href="https://github.com/kubernetes/kubernetes/issues/1899" rel="noreferrer">Github Issue #1899</a> but it looks unresolved as yet.</p>