<p>Just as the question says, I'm just looking to know if Kubernetes waits for some kind of confirmation from the previous cronjob that it has completely stopped before starting the new one, or if the kill signal is sent and the new job is started at the same time.</p>
<p>For reference, here is all the docs say on the replace policy:</p>
<p><a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy</a></p>
<blockquote>
<p>Concurrency Policy</p>
<ul>
<li>Replace: If it is time for a new job run and the previous job run hasn’t finished yet, the cron job replaces the currently running job run with a new job run</li>
</ul>
</blockquote>

Chris Morgan
<p><strong>Short intro/definition</strong></p>
<blockquote>
<ul>
<li>Cron jobs go back long in the history of UNIX and Linux. Combined with other Kubernetes technologies like Pods, containers, the
scheduler, and the intelligent algorithms for Pod placement and health
probes, CronJobs prove to be way more powerful than their traditional
OS-level counterparts.</li>
<li>Since they run on containers, CronJobs provide a lot of flexibility for the developers. They need not worry about which
platform the cron job runs on and the presence of the required
dependencies as everything runs on the container.</li>
<li>Kubernetes handles CronJob execution, what happens when it misses an execution time, and how many times the job should run. This allows
the developers to focus more on writing code and addressing business
issues rather than worrying about the internals of code execution.</li>
<li>The business application is still responsible for handling what happens when the cron job runs, does not run, gets canceled, or runs
concurrently.</li>
</ul>
</blockquote>
<p>Read more here: <a href="https://www.magalix.com/blog/kubernetes-patterns-the-cron-job-pattern" rel="nofollow noreferrer">cronjob</a>.</p>
<p>Referring to your question when a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">CronJob</a> has a concurrency policy set to <code>Replace</code> and it is still working, the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/" rel="nofollow noreferrer">Job</a> will be deleted and it also deletes the <a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="nofollow noreferrer">Pod </a> - look at the <a href="https://github.com/kubernetes/kubernetes/blob/6a19261e96b12c83e6c69d15e2dcca8089432838/pkg/controller/cronjob/cronjob_controller.go#L324" rel="nofollow noreferrer">code</a>.</p>
<p>While a Pod is  <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods" rel="nofollow noreferrer">deleting</a>  the Linux container/s will be sent a  <code>SIGTERM</code>  and then a  <code>SIGKILL</code>  after a grace period, default set to 30 seconds. The  <code>terminationGracePeriodSeconds</code>  property in a  <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podspec-v1-core" rel="nofollow noreferrer">PodSpec</a>  can be set to override that default.</p>
<p>Look at the  <a href="https://github.com/kubernetes/kubernetes/blob/3b440dfd5550b13278e40975a7cba13a3f129475/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go#L441-L443" rel="nofollow noreferrer">flag</a> in code which is added to the  <a href="https://github.com/kubernetes/kubernetes/blob/933f9a469feadcb1904e9d2b7258102ea89f6c7a/pkg/controller/cronjob/injection.go#L120-L123" rel="nofollow noreferrer"><code>DeleteJob</code></a>  function. This seems that this delete is only deleting values from the kube key/value store. This could mean the new Pod or Job could be created while the current Pod or Job is still terminating. You could confirm with a Job that doesn't respect a  <code>SIGTERM</code>  and has a  <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution" rel="nofollow noreferrer"><code>terminationGracePeriodSeconds</code></a>  set to a few times your clusters scheduling speed.</p>
<p>Take a look on @Matt's answer: <a href="https://stackoverflow.com/questions/59973600/what-does-shutdown-look-like-for-a-kubernetes-cron-job-pod-when-its-being-termi">cronjob-shuttingdown</a>.</p>
