You are viewing development documentation built from the latest commit on main (last tag v0.2.0-rc.2, source commit 25e1a892).
APIs and features are subject to change.
Quickstart
This guide walks you through installing Kure, generating one Flux Kustomization from Go, and handing it to Flux. It stays at the level of a single Kubernetes object. To build a whole cluster (Cluster, Node, Bundle, Application) and write the repository layout to disk, continue with the cluster-to-disk example .
Installation
You need Go 1.27.4 or later, the version that Kure’s go.mod declares for v0.2.0-rc.1. With an older Go, the go command downloads that toolchain when you add Kure. Create a module and add Kure:
Hello World: Generate a Simple Cluster Config
Create a minimal Go program that generates Kubernetes manifests. Start main.go with the package
clause and imports:
and put this in func main() { ... }:
That body is Example_quickstart in pkg/kubernetes/fluxcd, which go test runs and checks
against the Example’s own // Output: comment. The output below reproduces that comment by hand;
it is not generated.
Fetch the modules the program imports, then run it to see the generated YAML:
Output:
Deploy with Flux
The program prints the Kustomization to stdout. To deploy it you need a Flux installation that already watches your Git repository through a GitRepository named flux-system, and a ./clusters/production directory in that repository that holds the manifests the Kustomization should apply.
- Save the output into the repository Flux watches, then commit it
Save the file in the bootstrap path of your cluster, clusters/<cluster>/. That is the --path you gave to flux bootstrap. Do not use its flux-system subdirectory, because the kustomization.yaml there lists only the Flux components and Flux never applies other files in it.
- Flux reconciles automatically
If a Flux Kustomization already applies the directory you saved the file in, Flux picks up the new Kustomization on its next sync. Check the status:
- Or trigger manually
The hello-world Kustomization does not exist until Flux applies the file you pushed. First fetch the new commit, then reconcile the Flux Kustomization that applies the directory you saved the file in. In a default Flux bootstrap, both objects are named flux-system.
When flux get kustomizations lists hello-world, reconcile it directly:
Next Steps
- A whole cluster: The cluster-to-disk example builds a Cluster with Nodes, Bundles and Applications and writes the repository layout
- Flux workflow: The Flux workflow guide covers the generated Flux resources in depth
- Architecture: Read the Design Philosophy page for a deep dive into Kure’s design
- Building objects: The Builder Contract
page explains what a constructor does and does not set, when a
Set*/Add*helper exists, and how to read the maturity table - Examples: The examples page lists the runnable examples and sample data
- API Reference: See the full API at pkg.go.dev
- Patching: The patch engine moved to go-kure/launcher in the launcher extraction (ADR-018); see that repository for current documentation