Schedule container time at the Kubernet?

What is the recommended way to execute a container or container based on a time schedule? For example, a task starts at 2 a.m. for 10 minutes every day.

On a traditional Linux server, crontab will be easy to work with, and this is obviously still possible inside the container. However, since this task only takes 10 minutes, I looked for a mechanism to start the base container for a given time interval, and then disposed of the container.

Chronos (part of Mesos) has similar behavior, is this possible in the Container Engine?

+6
source share
5 answers

This is expected to be supported in version 1.3: https://github.com/kubernetes/kubernetes/pull/11980

UPDATE:

did not meet the deadline of 1.3, so he will sleep at 1.4

https://github.com/kubernetes/kubernetes/issues/2156#issuecomment-223385808

UPDATE (thanks @Kevinoid): It looks like it has reached alpha at 1.4, and progress is now tracked at https://github.com/kubernetes/features/issues/19 using the documentation at http://kubernetes.io/docs/ user-guide / cron-jobs /

+7
source

Unfortunately, cron job support for Kubernetes or Container Engine is currently not supported. Tracking Github is here if you want to share ideas about what features it should have, or express your interest in it!

+4
source

Now you need to work with the Pod routine and add kubectl to the cron tab on the machine.

eg. add

kubectl create -f <run-once-pod> 

to the cron tab.

+3
source

As already noted, this was added as part of K8s 1.4 and is here official documentation. (moved URL updated)

0
source

It seems that "Cron Jobs" (since 1.4) is the answer: http://kubernetes.io/docs/user-guide/cron-jobs/

0
source

All Articles