Skip to content

Instantly share code, notes, and snippets.



Last active Sep 6, 2018
What would you like to do?
CronJob をその場で Job を作って実行する方法 ref:
$ kubectl create job -h
Create a job with the specified name.
# Create a job from a CronJob named "a-cronjob"
kubectl create job test-job --from=cronjob/a-cronjob
--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in
the template. Only applies to golang and jsonpath output formats.
--dry-run=false: If true, only print the object that would be sent, without sending it.
--from='': The name of the resource to create a Job from (only cronjob is supported).
-o, --output='': Output format. One of:
--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the
annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.
--template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The
template format is golang templates [].
--validate=true: If true, use a schema to validate the input before sending it
kubectl create job NAME [--from=CRONJOB] [flags] [options]
Use "kubectl options" for a list of global command-line options (applies to all commands).
--from='': The name of the resource to create a Job from (only cronjob is supported).
$ kubectl create job <任意の名前> --from=cronjob/<CronJob の名前> -n <ネームスペース>
$ kubectl create job backup-db-2018-09-06 --from=cronjob/backup-db -n koudaiii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.