Disabling cronjob in Kubernetes when occur failed status

8/14/2019

I want disable the cronjob immediately when it occurs any errors (status failed).

My configuration file (Kubernetes version v1.15.0):

apiVersion: v1
kind: CronJob
metadata:
   name: test-suspend
spec:
   schedule: "*/10 * * * *"
   startingDeadlineSeconds: 30
   concurrencyPolicy: "Forbid"
   suspend: false
   jobTemplate:
   ...

How to config on yaml file ?

-- Toi Nguyen
kubernetes

0 Answers