Kubernetes Job scheduling

1/30/2018

I am looking for the following features in Kubernetes but unable to find documentation in this regards.

  1. Running a child Job after parent job(s) gets completed.
  2. Disabling Job for a while - Disabling/Enabling feature
  3. Manual Job triggering - If job needs to triggered manually for any reason
  4. Job Failure notification - Email notification or invoking an end point on a Job failure
  5. Is there any way to listen to Job status or getting Job history thru REST API?

Thanks

-- user1578872
kubernetes

1 Answer

1/30/2018

What do you mean my Job scheduling? CronJob? If yes

_2. You can disable scheduling new Job

Suspend: true
// This flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions.

Set Suspend field to be true.

PATCH /apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}
// You need to patch in correct format
{  
   "spec":{  
      "suspend":"true"
   }
}

_5. You can also get CronJob status. There you will find information about success/failure

GET /apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status

[1,3,4] these are not supported

-- Mir Shahriar Sabuj
Source: StackOverflow