Kubernetes batch job helper
-
if given a jobname, then looks for
${jobname}-job.yaml
in cloud-automation/kube/services/jobs after: -
if given a path, then assumes a path ending in
-cronjob.yaml
is a cron job -
filters the
yaml
file as a manifest template via gen3 gitops filter -
passing
-w
right after thejobname
(before its arguments) if wait for job finish
gen3 job run usersync
Generate the json that gen3 job run
forwards to kubernetes to create the job.
gen3 job json usersync
Launch the given job as a kubernetes cron job that runs on the given cron schedule.
gen3 job cron es-garbage @daily
Generate the json that gen3 job cron
forwards to kubernetes to create the cron job.
gen3 job cron-json es-garbage @daily
Cat the logs for the most recently launched gen3 job
.
Note that when gen3 job logs jobname
runs immediately after a gen3 job run jobname
command
may output messages something like error pod not running
until the
job's pods launch.
gen3 job logs usersync
Get the pods associated with the given jobname - just does a prefix match
gen3 job pods usersync
gen3 job run usersync
gen3 job logs usersync
- tail the logs:
gen3 job logs usersync -f