在 Argo CronWorkflow YAML 文件中,可以设置 successfulJobsHistoryLimit
和 failedJobsHistoryLimit
的值为 -1,相当于禁止保留任何成功或失败的 CronJob 执行历史。因此,即使 CronWorkflow 在恢复后立即提交,执行历史也不会保留。
示例代码:
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: my-cron-workflow
spec:
schedule: "*/5 * * * *"
workflowSpec:
entrypoint: my-entrypoint
templates:
...
successfulJobsHistoryLimit: -1
failedJobsHistoryLimit: -1