Skip to main content
This lesson shows how to use a Kustomization resource that points at an existing kustomization.yaml (a Kustomize overlay) stored in a Git branch. When the Kustomization references a path that already contains an overlay, the Kustomize Controller will validate and apply the manifests directly — skipping overlay generation — which simplifies your GitOps workflow. Overview — what you will do:
  • Switch to the 3-demo branch (this branch contains a kustomization.yaml and plain Kubernetes manifests).
  • Create a Flux GitRepository source that references the 3-demo branch.
  • Create a Flux Kustomization that points to the overlay path in that source.
  • Observe Flux fetching the branch and applying the namespace and application resources.

1. Switch to the 3-demo branch

Checkout the branch that contains the overlay and the manifests:
On this branch the repository contains, for example in ./kustomize:
  • deployment.yml
  • service.yml
  • namespace.yml
  • kustomization.yaml
Example kustomization.yaml (overlay file) in the repo:
When a Kustomization resource points at a Git source path that already includes a kustomization.yaml (or a kustomize directory with an overlay), Flux will use that overlay directly and will not generate a separate overlay.

2. Create a GitRepository source (Flux)

From your Flux cluster repo directory (for example block-buster/flux-clusters/dev-cluster) create a GitRepository resource that references the 3-demo branch and export it to YAML:
The exported GitRepository YAML will look like:
Save and commit 3-demo-source-git-bb-app.yml to your cluster manifests repository (if you manage Flux configuration in Git), or apply it directly to your cluster so Flux can start reconciling that source.

3. Create a Flux Kustomization that points at the overlay

Create a Kustomization resource that points to the overlay path (for this example ./kustomize) and export it:
The exported Kustomization YAML will resemble:
Save and commit 3-demo-kustomize-git-bb-app.yml to your Flux manifests repository (or apply it) so Flux can reconcile and apply the overlay.
Ensure the target-namespace does not conflict with existing resources and that you have appropriate RBAC permissions for Flux to create or manage the specified namespace and resources.

4. Observe Flux fetching and applying the overlay

After Flux reconciles the GitRepository and Kustomization: Check Git sources:
Example output:
Check Kustomizations:
Example output:
Verify the namespace and deployed resources:
In this demo branch, the application has a gameplay change: the player starts with three lives instead of one.
A web screenshot of a "BLOCK BUSTER" breakout-style game showing colored brick rows, a paddle at the bottom and a bouncing ball. The top panel displays pod information like Pod Name, Pod IP, Namespace and app version.
That’s it — because the repo already contained the overlay at the referenced path, the Kustomize Controller applied the manifests directly from the repo: validating and reconciling resources without rebuilding the overlay.

Quick reference

Further reading:

Watch Video

Practice Lab