Search code examples
kubernetescronworkflowopenstackopenstack-nova

OpenStack K8s : start instance for a specific cronjob


I want to schedule each day a cronjob who create an instance and run a Dockerfile on it.

I created a Mistral Workflow who create an instance with Nova but I don't found how to start a process on the created instance.

Maybe an interaction is possible directly in K8s ?

Thanks!


Solution

  • https://wiki.openstack.org/wiki/Mistral/Cookbooks/AdministrationCloudCron is an example of how to run a command on a list of hosts, using Mistral. Since your list is a single host, you have to simplify the example. However, Mistral seems to be a tool for running workloads on existing hosts. You, on the other hand, want to run a Dockerfile on a server that you are launching.

    My thinking is that Mistral is overkill for your use case. What's wrong with cron? After all, Mistral uses cron for periodic tasks anyway. Use a crontab like 0 4 * * * openstack server create ... --user-data myscript.sh ....