<p>I am trying to create a housekeeping job where I erase namespaces that have not been used for seven days. I have two options:</p>

<ol>
<li>I can use a Job, but I don't know how to make sure the Jobs are running on the date that I want.</li>
<li>I read about <a href="https://stackoverflow.com/questions/5473780/how-to-setup-cron-to-run-a-file-just-once-at-a-specific-time-in-future">CronJob</a>. Unfortunately, CronJob in Kubernetes can only support 5 fields (default format). This means we can only define dates and months, but not years. </li>
</ol>

<p>Which one is better to use?</p>

irvifa
<p>Kubernetes CronJob API is very similar to cron as you said and doesn't have a  year field.</p>

<p>If you need something that gets scheduled on time, you should write a kubernetes controlller that waits until the date you want, and then calls into Kubernetes  API to create a <strong>Job</strong> object. This shouldn't be very complicated if you can program Go with the examples here: <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go</a></p>
