Skip to content

Flux Kustomize DependsOn Quick Fix - Kustomization Ordering

DodaTech Updated 2026-06-26 1 min read

Flux Kustomization dependsOn ensures resources are applied in the correct order. Missing or circular dependencies cause reconciliation failures. This guide covers the fix.

Quick Fix

Wrong

apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: apps
spec:
  dependsOn:
  - name: infrastructure
  path: ./apps

The issue: dependsOn references infrastructure but does not specify namespace. If infrastructure is in a different namespace, the dependency never resolves.

apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
  name: apps
  namespace: teams
spec:
  dependsOn:
  - name: infrastructure
    namespace: infra
  - name: security
    namespace: infra
  path: ./apps
  prune: true
# Expected output after applying the fix
# Kustomization apps depends on infrastructure and security
# Dependencies reconciled first (infra namespace)
# apps reconciled after dependencies are ready
# Status: True (Ready)

Prevention

  • Always specify both name and namespace in dependsOn
  • Define explicit dependency chains for resource ordering
  • Avoid circular dependencies between Kustomizations
  • Verify dependency resolution with flux get kustomizations
  • Use dependency chains for infrastructure before application resources

DodaTech Tools

Doda Browser's dependency graph shows Kustomization relationships and reconciliation order. DodaZIP archives dependency configurations. Durga Antivirus Pro detects circular dependency patterns.

FAQ

How does Flux handle cross-namespace Kustomization dependencies?

When namespace is specified in dependsOn, Flux looks for the referenced Kustomization in that namespace. Without namespace, it looks in the same namespace. ||| What happens if a dependency Kustomization fails? The dependent Kustomization stays in "Progressing" state until the dependency succeeds. Flux retries reconciliation at each interval. ||| Can a Kustomization depend on a HelmRelease? No, dependsOn only works between Kustomizations. For HelmRelease dependencies, use the HelmRelease's dependsOn field instead.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro