Skip to content

Argo Workflows Pod GC Quick Fix - Pod Garbage Collection

DodaTech Updated 2026-06-26 1 min read

Argo Workflows pod GC (Garbage Collection) removes completed workflow pods to free cluster resources. Incorrect GC configuration leaves terminated pods consuming resources. This guide covers the fix.

Quick Fix

Wrong

spec:
  podGC:
    strategy: OnPodCompletion

The issue: missing labelSelector or deleteDelayDuration. Pods are deleted immediately on completion, making logs inaccessible for debugging. No ability to inspect failed pod logs.

spec:
  podGC:
    strategy: OnWorkflowCompletion
    deleteDelayDuration: 5m
    labelSelector:
      matchLabels:
        workflows.argoproj.io/workflow: "{{workflow.name}}"
# Expected output after applying the fix
# Pods retained for 5 minutes after workflow completion
# Logs accessible during the retention window
# All pods deleted after 5 minutes via label selector
# Cluster resources reclaimed

Prevention

  • Use OnWorkflowCompletion instead of OnPodCompletion for debugging
  • Set deleteDelayDuration to retain logs temporarily
  • Use labelSelector to target specific pods for GC
  • Set <a href="/design-patterns/strategy/">Strategy</a>: OnWorkflowSuccess to retain failed pods for analysis
  • Use --pod-gc-<a href="/design-patterns/strategy/">Strategy</a> flag for one-off workflow runs

DodaTech Tools

Doda Browser's GC monitor shows pod cleanup status and retention periods. DodaZIP archives pod logs before deletion for long-term storage. Durga Antivirus Pro ensures GC respects security retention policies.

FAQ

What pod GC strategies does Argo support?

Strategies include OnPodCompletion, OnWorkflowCompletion, OnWorkflowSuccess, and OnWorkflowFailure. Each controls when pods are deleted relative to workflow state. ||| How long are pods retained with deleteDelayDuration? The deleteDelayDuration specifies a duration after the Strategy trigger before pods are deleted. Default is 0 (immediate deletion). ||| Can I disable pod GC completely? Set podGC.<a href="/design-patterns/strategy/">Strategy</a>: None to skip pod cleanup. Pods are not automatically deleted. Manually clean up with kubectl delete pods -l workflows.argoproj.io/workflow=<name>.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro