<p>I have a job in kubernetes cluster that is run through cron in jenkins. As the cluster sometimes does not have enough resources to start a pod, it is in waiting status until it finds free resources. How can I stop/kill job and the waiting pod if certain time has passed.</p>

<p>Well you can't do that, because a controller or watcher for Job/ cronjob object is always taking care to spawn the desired number of replicas mentioned by you in the specs.</p>
<p>There is one option that you can add to your spec file and configure it in such a way that if that much time against the scheduled time gets passed then the pod won't be created.</p>
<p>You can always add <strong>startingDeadlineSeconds</strong> in the cronjob spec, now if the schedule is missed or nodes were down then pod won't be spawned here.</p>
<p>For more information you can refer to following <a href="https://medium.com/@hengfeng/what-does-kubernetes-cronjobs-startingdeadlineseconds-exactly-mean-cc2117f9795f" rel="nofollow noreferrer">link</a>, hope this helps.</p>
