K8S v2 CronJob Single Run


#1

In the latest kubernetes cli there is a way to create a K8S Job from a CronJob for single run scenarios. Does Spinnaker have any planned support for this type of workflow? We currently deploy our CronJobs through Spinnaker but would love to be able to have an additional way to do something like:

  1. Deploy CronJob
  2. Run Single-run Job based off CronJob manifest
  3. Delete Single Run Job (so we don’t have a standalone Job taking up resources in our cluster)
  4. Run Smoke-Tests,
  5. If Smoke Tests Fail then: Rollback to previous CronJob`.

What is the best way to support this type of workflow? I haven’t dug super deep but the only parts that I don’t understand how to do would be to 1. Run the CronJob as a Single-Run 2. Rollback CronJob. I have Rollbacks enabled for our Deployments, but I don’t think the Job, or CronJob Kind are versioned in K8s.

EDIT I’ve implemented Rollbacks via a combination of Tagging our image (via Jenkins – does this fall in Spinnaker’s wheelhouse?) on success and using a custom docker artifact that can specify a specific tag to rollback to on failure

Open to any ideas here that help support this workflow


#2

I’ve been able to mimic this workflow with a combination of calling back and forth to our Jenkins instance. This is less than ideal because that then requires our Jenkins Service Account to have access to deploy to our clusters (which ideally we’d like to stay away from). It really seems like the only part missing that would support this workflow is the functionality for running a job from a cronjob