title: How to determine a failed kubernetes deployment?
body: <p>I create a Pod with Replica count of say 2, which runs an application ( a simple web-server), basically it's always running command - However due to mis-configuration, sometimes the command exits and the pod is then Terminated.</p>
  
  <p>Due to default <code>restartPolicy</code> of <code>Always</code> the pod (and hence the container) is restarted and eventually the Pod status is <code>CrashLoopBackOff</code>. </p>
  
  <p>If I do a <code>kubectl describe deployment</code>, it shows Condition as <code>Progressing=True</code> and <code>Available=False</code>.</p>
  
  <p>This looks fine - the question is - how do I mark my deployment as 'failed' in the above case? </p>
  
  <p>Adding a <code>spec.ProgressDeadlineSeconds</code> doesn't seem to be having an effect. </p>
  
  <p>Will simply saying <code>restartPolicy</code> as <code>Never</code> be enough in the Pod specification?</p>
  
  <p>A related question, is there a way of getting this information as a trigger/webhook, without doing a <code>rollout status</code> watch? </p>