You can delete them, or for cronjobs you could change the configuration such that less history is retained.
CronJobs have a configurable successfulJobHistoryLimit and failedJobHistoryLimit.
https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits
The default values are successful: 3 and failed: 1, but some of these the Viya deployment modifies, like for backups.
You can run this command to see which cronjobs are active and their JobHistoryLimit settings:
kubectl -n namespace get cronjob -o custom-columns=Name:.metadata.name,Suspended:.spec.suspend,SuccessLimit:.spec.successfulJobsHistoryLimit,FailLimit:.spec.failedJobsHistoryLimit
Here's the output from my environment:
Name Suspended SuccessLimit FailLimit
sas-backup-purge-job false 7 7
sas-backup-pv-copy-cleanup-job true 100 1
sas-crunchy-platform-postgres-repo1-full false 3 1
sas-crunchy-platform-postgres-repo1-incr false 3 1
sas-import-data-loader false 3 1
sas-inventory-collector true 3 1
sas-pyconfig true 3 1
sas-restore-job true 100 1
sas-scheduled-backup-all-sources true 100 100
sas-scheduled-backup-incr-job true 100 100
sas-scheduled-backup-job false 100 100
sas-start-all false 3 1
sas-stop-all false 3 1
sas-studio-steps true 3 1
sas-update-checker false 3 1
To change this configuration and have it persist through updates you could use a patch transformer like this:
apiVersion: builtin
kind: PatchTransformer
metadata:
name: sas-backup-jobs-change-history-retention
patch: |-
- op: replace
path: /spec/successfulJobsHistoryLimit
value: "10"
- op: replace
path: /spec/failedJobsHistoryLimit
value: "10"
target:
kind: CronJob
annotationSelector: sas.com/component-name=sas-backup-job
version: v1
... View more