How to Modify "FailedJobsHistoryLimit" or "SuccessfulJobsHistoryLimit" Settings for CronJobs?
Problem
To modify the default values for FailedJobsHistoryLimit or SuccessfulJobsHistoryLimit settings in CronJobs.
Environment
Self-Hosted Private Cloud Director - Virtualisation: v2025.4 and Higher.
Self-Hosted Private Cloud Director - Kubernetes: v2025.4 and Higher.
Private Cloud Director - Virtualisation: v2025.4 and Higher.
Private Cloud Director - Kubernetes: v2025.4 and Higher.
Procedure
Take the backup of the existing cronjob using the below command:
$ kubectl get cronjob -n <REGION_NAMESPACE> <CRONJOB_NAME> -o yaml > <cronjob-name>.bkEdit the cronjob object file.
$ kubectl edit cronjob -n <REGION_NAMESPACE> <CRONJOB_NAME>Under
specsection modify the desired value forFailedJobsHistoryLimitorSuccessfulJobsHistoryLimit.
spec:
failedJobsHistoryLimit: 2 <--- Update desired value for failedJobsHistoryLimit
.
.
successfulJobsHistoryLimit: 4 <--- Update desired value for successfulJobsHistoryLimitSave the file.
Verify the change.
Additional Information
To update the default values for all CronJobs, apply the same procedure to each one.
PreviousHost With GPU Hardware Cannot Be Assigned to a Cluster From the UI
Nextairctl restore Fails with TypeError: Legacy Consul Placeholder Keys
Last updated
