Users can create WebAssembly workloads that execute once leveraging the Command Trigger, which allows us to build and run Jobs and CronJobs in Kubernetes environments.
Although I was able to create the corresponding Kubernetes manifests manually, it is tedious to create full fledged manifests that use Runtime Configuration Files.
Being able to scaffold both Jobs and CronJobs would be very handy.
CLI Interface Suggestions
IMO, the most intuitive CLI interface would rely on using flags:
# Create a manifest of kind Job when --job is present
spin kube scaffold -f ttl.sh/job:12h --runtime-config-file ./rtc.toml --job
# Create a manifest of kind CronJob when --cron and --schedule are present
spin kube scaffold -f tt.sh/cronjob:12h --runtime-config-file ./rtc.toml --cron --schedule "* * * * *"
# Alternatively --cron could take the actual schedule as value
spin kube scaffold -f tt.sh/cronjob:12h --runtime-config-file ./rtc.toml --cron "* * * * *"
As an alternative, job and cron could be defined as sub-commands of scaffold:
# Create a manifest of kind Job
spin kube scaffold job -f ttl.sh/job:12h --runtime-config-file ./rtc.toml
# Create a manifest of kind CronJob
spin kube scaffold cron -f tt.sh/cronjob:12h --runtime-config-file ./rtc.toml --schedule "* * * * *"
Users can create WebAssembly workloads that execute once leveraging the Command Trigger, which allows us to build and run
Jobs
andCronJobs
in Kubernetes environments.Although I was able to create the corresponding Kubernetes manifests manually, it is tedious to create full fledged manifests that use Runtime Configuration Files.
Being able to scaffold both
Jobs
andCronJobs
would be very handy.CLI Interface Suggestions
IMO, the most intuitive CLI interface would rely on using flags:
As an alternative,
job
andcron
could be defined as sub-commands of scaffold:Sample CronJob Manifest
See the following
CronJob
manifest for reference: