<p><strong>I would like to know if it is possible to send notification using yaml config if the kubernetes job fails?</strong> </p>

<p>For example, I have a kubetnetes job which runs once in everyday. Now i have been running a jenkins job to check and send notification if the job fails. <strong><em>Do we have any options to get notification from kubernetes jobs directly if it fails? It should be something like we add in job yaml</em></strong></p>

<p>I'm not sure about any built in notification support. That seems like the kind of feature you can find in external dedicated monitoring/notification tools such as Prometheus or Logstash output.</p>

<p>For example, you can try this tutorial to leverage the prometheus metrics generated by default in many kubernetes clusters: <a href="https://medium.com/@tristan_96324/prometheus-k8s-cronjob-alerts-94bee7b90511" rel="noreferrer">https://medium.com/@tristan_96324/prometheus-k8s-cronjob-alerts-94bee7b90511</a></p>

<p>Or you can theoretically setup Logstash and monitor incoming logs sent by filebeat and conditionally send alerts as part of the output stage of the pipelines via the "email output plugin"</p>

<p>Other methods exist as well as mentioned in this similar issue: <a href="https://stackoverflow.com/questions/34138765/how-to-send-alerts-based-on-kubernetes-docker-events/34139082">How to send alerts based on Kubernetes / Docker events?</a></p>

<p>For reference, you may also wish to read this request as discussed in github: <a href="https://github.com/kubernetes/kubernetes/issues/22207" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/22207</a></p>
