<p>I would like to have a docker container active only during certain time's in the day so that a Test Automation can run? Is it possible?</p>

Shaun Whyte
<p>Yes it is <strong>possible</strong>. <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">Cronjobs</a> is designed to run a job periodically on a given schedule, written in Cron format. A <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/" rel="nofollow noreferrer">Job</a> creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate.</p>
<p>To run your automation tests</p>
<ul>
<li>You should create a Cronjob definition</li>
<li>Set the cron timer</li>
<li>Call your CMD</li>
</ul>
<p>Here is a sample Hello Wordl example:</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>
