Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
How to make cron job start after x seconds?

I think I am misunderstanding Kubernetes CronJobs. On the CKAD exam there was a question to have a CronJob run every minute, but it should start after an arbitrary amount of time. I don't see any properties for CronJobs or Jobs to have them start after a specific time. Should that be part of the cron string or am I completely misunderstanding?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You can schedule your CronJob to start at specific date/time and than run every minute or however you would like to set it. There is a powerful online tool that can help you with it. For example:

0 0/10 10/1 ? * * *

will schedule your CronJob to run every 10 mins starting at 10h of the day. Or:

0 0/10 * ? * 6/1 *

will schedule your CronJob to run every 10 mins starting on Friday.

The important thing to keep in mind while using this particular approach is to be aware of the timezone that your cluster is running in:

All CronJob schedule: times are based on the timezone of the kube-controller-manager.

If your control plane runs the kube-controller-manager in Pods or bare containers, the timezone set for the kube-controller-manager container determines the timezone that the cron job controller uses.

More info/examples about scheduling can be found below:

  • Cron schedule syntax

  • Running Automated Tasks with a CronJob

over 4 years ago · Santiago Trujillo Relatório

0

maybe you misunderstood the question, it was to terminate the job if it didn't complete in x seconds. you should use the .spec.activeDeadlineSeconds to satisfy the requirment.

over 4 years ago · Santiago Trujillo Relatório

0

you could do

sleep "seconds"; echo " * * * * * command" >> path/to/crontab

I feel like maybe the question is worded incorrectly. It probably meant something like every minute on every Saturday day.

 * * * * SAT

Or every minute through range of hours

* 9-17 * * *

https://crontab.guru/examples.html

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda