I have a cronjob running every couple of minutes in kubernetes and would like to set up an alert that notifies me when the cronjob stops working.
I'm expecting it to fail sometimes, it's calling two REST endpoints and they won't always be available.
I want to know if the last successful run happened more than x minutes ago. For this I need the last successful completion timestamp.
I'd like to use the kubectl
command line tool. How do I do this?