I am trying to create a housekeeping job where I erase namespaces that have not been used for seven days. I have two options:
Which one is better to use?
Kubernetes CronJob API is very similar to cron as you said and doesn't have a year field.
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 Job object. This shouldn't be very complicated if you can program Go with the examples here: https://github.com/kubernetes/client-go