Skip to content

Flux Kustomize Prune Quick Fix - Resource Pruning

DodaTech Updated 2026-06-26 1 min read

Flux Kustomization pruning automatically removes resources that are no longer in the manifests. Disabled or misconfigured pruning leaves orphaned resources in the cluster. This guide covers the fix.

Quick Fix

Wrong

spec:
  prune: false
  path: ./apps/production

With prune: false, removing a Deployment manifest from the git repository does not delete the Deployment from the cluster. Orphaned resources accumulate over time.

spec:
  prune: true
  path: ./apps/production
  interval: 10m
  retryInterval: 2m
# Expected output after applying the fix
# Prune enabled: removed resources deleted from cluster
# Example: Deployment removed from git → Deployment deleted from cluster
# No orphaned resources accumulate
# Kustomization maintains cluster-manifest consistency

Prevention

  • Enable prune: true for all production Kustomizations
  • Verify prune behavior by removing a test resource first
  • Use flux diff kustomization <name> --path <path> before applying
  • Set retryInterval for faster recovery after pruning failures
  • Monitor prune operations with kubectl describe kustomization

DodaTech Tools

Doda Browser's prune monitor shows deleted resources and pruning history. DodaZIP archives prune configurations for audit. Durga Antivirus Pro validates prune safety.

FAQ

What resources are pruned by Flux?

Any resource that was previously applied by the Kustomization but is no longer present in the current kustomize build output is pruned (deleted). ||| How does Flux handle pruning of custom resources? Custom resources are pruned the same as built-in resources. Ensure the CRD is not managed by the same Kustomization to avoid deletion of the CRD itself. ||| Can I prevent specific resources from being pruned? Yes, add the annotation kustomize.toolkit.fluxcd.io/prune: disabled to resources you want to exclude from pruning, or manage them with a separate Kustomization.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro