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.
Right
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
OnWorkflowCompletioninstead ofOnPodCompletionfor debugging - Set
deleteDelayDurationto retain logs temporarily - Use
labelSelectorto target specific pods for GC - Set
<a href="/design-patterns/strategy/">Strategy</a>: OnWorkflowSuccessto 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
← Previous
Argo Workflows Param Quick Fix - Parameter Passing Errors
Next →
Argo Workflows Priority Quick Fix - Workflow Priority Classes
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro