Skip to content

chumaltd/kubectl-pick-job

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

kubectl-pick-job

Pick one time job from CronJob list interactively.

Install

Just copy kubectl-pick-job file under any $PATH directory. chmod +x is also needed. kubectl will find it as a plugin.

kubectl-pick-job requires bash >= 4.0.
Most Linux distros have them. MacOS is shipped with older bash.

Usage

Just run kubectl pick job, and you'll see the CronJob list.
Single job is created after selecting one.

$ kubectl pick job -h

kubectl pick job version v1.0.0
  Usage:    kubectl pick job [options] [cronjob name>]
  Options:
            -n <namespace>   Specify namespace
            -h               Show this usage

Delete Job

Set ttlSecondsAfterFinished: <seconds> to spec.jobTemplate.spec in each CronJob manifest.

It clears up completed jobs automatically.

You can refer to JobSpec for further infomation.

Without ttlSecondsAfterFinished, you need to delete previous jobs manually with kubectl delete.
This plugin does nothing after job creation.

For Tekton

As a tekton-pipelines flavor, there is tkn-runner.
You can construct more complex CI tasks with tekton.

About

Pick one time job from CronJob list interactively

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages