# Watches ./dev, so the GitRepository and the Kustomization below it reconcile # from git like any other manifest. It lives in ./dev itself, so it also manages # itself — the arrangement `flux bootstrap` sets up, which flux-operator does # not create, and the same one the platform repos use. # # It sits in the agents namespace, not flux-system: a sourceRef resolves in the # Kustomization's own namespace, and this is the agent team's to own. # # Three manual applies, once, to close the loop — nothing can watch ./dev until # the namespace and the source that serves it exist: # # kubectl apply -f k8s/namespace.yaml # kubectl apply -f dev/gitrepository.yaml # kubectl apply -f dev/bootstrap-kustomization.yaml # # After that every file in this repo, this one included, reconciles from git. # # Sharp edge: with prune enabled, deleting flux-kustomization.yaml from git # deletes the Kustomization it defines, and that Kustomization's own prune then # removes the whole deployment. Correct GitOps behaviour, blast radius two # levels deep. apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: catalog-agent-bootstrap namespace: agents spec: interval: 10m sourceRef: kind: GitRepository name: catalog-agent path: ./dev prune: true