Flux Kustomization "path not found" in CI
kustomize-controller resolved the source artifact and then looked for spec.path inside it, but that directory is not present. The path is misspelled, points at the wrong repo layout, or the directory was moved or deleted.
What this error means
A Kustomization reports "False" with "path not found" or "no such file or directory" for the configured spec.path.
kustomization path not found: stat /tmp/kustomization-123/clusters/prod: no such file or directoryCommon causes
spec.path is misspelled or moved
The directory named in spec.path does not exist at the source revision because it was renamed, moved, or never existed.
The source points at the wrong repo or ref
The GitRepository resolves to a revision whose layout does not contain that path, so kustomize-controller cannot find it.
How to fix it
Set spec.path to a directory that exists
- List the directories at the source revision to find the real path.
- Update
spec.pathto match, using a path relative to the repo root. - Reconcile the Kustomization with its source.
spec:
path: ./clusters/prod
sourceRef:
kind: GitRepository
name: infraConfirm the source revision layout
Check the resolved source revision to be sure the path exists at that commit.
flux get sources git infra
kubectl -n flux-system describe kustomization appsHow to prevent it
- Keep spec.path in sync with the repository directory layout.
- Use paths relative to the repo root, matching the source ref.
- Review Kustomization paths when you restructure the repo.