利用CronWorkflow定时清理ArgoWorkflows

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
  name: cron-clean-workflows
  namespace: argo
spec:
  schedules: 
    - "0 9 * * *"
  timezone: Asia/Shanghai
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1
  workflowSpec:
    serviceAccountName: argo-agent
    imagePullSecrets:
    - name: secrets
    entrypoint: cron-clean-workflows
    templates:
    - name: cron-clean-workflows
      container:
        image: argo-base:v1.0_20250324
        command: ["/bin/sh", "-c"]
        args:
        - |-
          argo delete --older 7d -n argo

https://argo-workflows.readthedocs.io/en/latest/cron-workflows/#cron-workflows

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容