Skip to content

Flux Kustomization Quick Fix - Kustomize Reconciliation

DodaTech Updated 2026-06-26 1 min read

Flux Kustomization applies Kubernetes manifests from git/OCI/bucket sources using kustomize. Misconfigured kustomization paths or missing dependencies cause reconciliation failures. This guide covers the fix.

Quick Fix

Wrong

apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: apps
spec:
  interval: 10m
  sourceRef:
    kind: GitRepository
    name: flux-system

The issue: no path specified, so Flux tries to apply the root of the repository which may not have a kustomization.yaml. Also missing prune: true for garbage collection.

apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: apps
spec:
  interval: 10m
  path: ./apps/production
  prune: true
  sourceRef:
    kind: GitRepository
    name: flux-system
  healthChecks:
  - apiVersion: apps/v1
    kind: Deployment
    name: my-app
    namespace: apps
# Expected output after applying the fix
# Kustomization applied from ./apps/production
# Prune enabled: removed resources are deleted from cluster
# Health checks verify Deployment my-app is ready
# Status: True (Ready)

Prevention

  • Always specify path pointing to a directory with kustomization.yaml
  • Set prune: true to automatically remove resources no longer in manifests
  • Add healthChecks for deployment verification
  • Use dependsOn for cross-kustomization ordering
  • Validate kustomize output with kustomize build <path> before committing

DodaTech Tools

Doda Browser's kustomization dashboard shows sync status and drift detection. DodaZIP archives kustomization configurations. Durga Antivirus Pro validates kustomize transforms.

FAQ

How does Flux handle kustomize overlays?

Flux builds the kustomize directory at path using kustomize build. Overlays in subdirectories must be referenced from the main kustomization.yaml. ||| What is the purpose of the prune flag? When prune: true, Flux removes any resource that exists in the cluster but is no longer defined in the kustomization. This prevents configuration drift. ||| How do I apply resources in a specific order? Use dependsOn to create dependency chains between Kustomizations. Flux respects the dependency order during reconciliation.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro