Skip to main content
In this lesson you’ll create a GitRepository source and a Kustomization resource so Flux pulls plain YAML manifests from a separate repository and deploys them into a target namespace. What you’ll do
  • Checkout the demo branch containing the application manifests.
  • Create a GitRepository source (prefer declarative and commit it to your Flux cluster repo).
  • Create a Kustomization that points to the manifests path in the source repository.
  • Verify the resources reconcile and the application is running.
Store Flux sources and Kustomizations declaratively in Git. Imperative creation (directly creating resources in the cluster) makes recovery and auditing harder after a disaster. Use --export to generate YAML and commit it to your Git repository so Flux can reconcile from Git.

Prerequisites

  • Flux CLI installed and bootstrapped into your cluster.
  • Local clone of the application source repository (example: ~/bb-app-source).
  • Local clone of your Flux cluster repository (example: ~/block-buster/flux-clusters/dev-cluster).
If you need Flux docs: FluxCD Documentation.

1) Switch to the demo branch

Checkout the branch that contains the manifests to deploy (in this demo: 2-demo).
The manifests in this branch reference the updated image and application version. Example excerpt:

2) Create a GitRepository source (imperative vs declarative)

You can create a GitRepository source imperatively using the Flux CLI. This will create the resource in the cluster and fetch an artifact immediately:
Example CLI output (shortened):
Validate the created source is stored as an artifact:
Creating Flux resources imperatively is useful for quick tests, but it’s not recommended for long-term management. If the resource only exists in-cluster (and not in your Git repo), you lose the ability to recreate or audit desired state from Git after a disaster.

3) Store the source declaratively (export YAML and commit)

Switch to your Flux cluster repository and export the GitRepository manifest to YAML. Committing this file to Git ensures Flux controllers can reconcile it from your repository.
Example exported YAML:
Commit the file (e.g., under flux-clusters/dev-cluster) so Flux can pick it up from Git.

4) Create a Kustomization that points to the source and manifests path

Export a Kustomization resource that references the GitRepository source and points to the folder inside that repo containing the manifests (in this demo: ./manifests). Save the exported YAML and commit it to your Flux cluster repo.
Example exported Kustomization YAML:
Key spec fields at a glance: Commit both 2-demo-source-git-bb-app.yml and 2-demo-kustomize-git-bb-app.yml to your Flux repo (for example, under flux-clusters/dev-cluster).

5) Verify reconciliation and application deployment

After committing, Flux controllers will automatically reconcile the new manifests from Git. Check the stored source artifact:
Check Kustomization status:
Confirm the target namespace and the resources were created:
List resources in the deployed namespace:
Open the NodePort service in your browser (use a cluster node IP and the NodePort shown) to verify the running application. In this demo the application image is version v7.2.0, which updates the gameplay visuals slightly compared to the previous version:
A screenshot of a browser-based Breakout-style game titled "BLOCK BUSTER," showing rows of colored bricks, a paddle at the bottom and a yellow ball in play. Above the game area is a status panel with pod name, pod IP, namespace and app version details.

Summary

You have:
  • Created a GitRepository source pointing to an external repository containing plain YAML manifests.
  • Created a Kustomization that deploys those manifests into a cluster namespace.
  • Followed the recommended declarative workflow: export -> commit -> Flux reconciles from Git.
Further reading

Watch Video