I have a CronJob in my k8s cluster which I run every 5 minutes. I occasionally have issues where the pod cannot be started in this time (let's not get into that). Is it possible to configure the Job to stop trying after a specific amount of time?
Did you try startingDeadlineSeconds ?
According to the documentation:
The .spec.startingDeadlineSeconds field defines a deadline (in whole seconds) for starting the Job, if that Job misses its scheduled time for any reason.
After missing the deadline, the CronJob skips that instance of the Job (future occurrences are still scheduled).
For example, if it is set to 200, it allows a Job to be created for up to 200 seconds after the actual schedule.
For Jobs that miss their configured deadline, Kubernetes treats them as failed Jobs. If you don't specify startingDeadlineSeconds for a CronJob, the Job occurrences have no deadline.