I have a spinnaker pipeline that deploys a db-job to k8s. I would like to be able to delete the job before deploying another one, i.e. to add a spinnaker stage or to somehow configure job so it deletes itself. I know that cronjob would be great for it, but it is in beta and not stable enough to be used for db operations. I have tried to add a stage to spinnaker like this:
{
"account": "k8s-devops-v2",
"cloudProvider": "kubernetes",
"location": "loc",
"manifestArtifactAccount": "loc-open-source",
"manifestName": "job my-job-name",
"mode": "static",
"name": "Delete Db job",
"options": {
"cascading": true,
"gracePeriodSeconds": null
},
"type": "deleteManifest"
}
but it won't work. I also don't want to use ttl because I wan't the latest job to be present until the new one is created. Are there any other options? What is the best practice for this?