Quickstart
Quickstart Guide
This guide walks you through installing Kure, generating your first cluster configuration, and deploying with Flux.
Installation
Add Kure as a Go module dependency:
go get github.com/go-kure/kure@latestHello World: Generate a Simple Cluster Config
Create a minimal Go program that generates Kubernetes manifests:
package main
import (
"os"
"time"
"github.com/go-kure/kure/pkg/io"
"github.com/go-kure/kure/pkg/kubernetes/fluxcd"
kustv1 "github.com/fluxcd/kustomize-controller/api/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func main() {
ks := fluxcd.CreateKustomization("hello-world", "flux-system")
fluxcd.SetKustomizationSourceRef(ks, kustv1.CrossNamespaceSourceReference{
Kind: "GitRepository",
Name: "flux-system",
})
fluxcd.SetKustomizationPath(ks, "./clusters/production")
fluxcd.SetKustomizationInterval(ks, metav1.Duration{Duration: 5 * time.Minute})
fluxcd.SetKustomizationPrune(ks, true)
io.Marshal(os.Stdout, ks)
}Run the program to see the generated YAML:
go run main.goOutput:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: hello-world
namespace: flux-system
spec:
interval: 5m
path: ./clusters/production
prune: true
sourceRef:
kind: GitRepository
name: flux-systemDeploy with Flux
Once you have generated manifests, deploy them using Flux:
- Commit the manifests to your Git repository
git add clusters/
git commit -m "Add hello-world kustomization"
git push- Flux reconciles automatically
If Flux is already watching your repository, it will automatically apply the new Kustomization. Check the status:
flux get kustomizations- Or trigger manually
flux reconcile kustomization flux-system --with-sourceNext Steps
- Architecture: Read the Design Philosophy page for a deep dive into Kure’s design
- Examples: Explore the
examples/directory for more complex configurations - API Reference: See the full API at pkg.go.dev
- Patching: Learn about declarative patching in the README