Files
kong-customers-api/dev/bootstrap-kustomization.yaml
T
Stéphane Tailland 848bf91d64 Reconcile this repo's Flux entrypoints instead of applying them by hand
dev/ declares this repo's GitRepository, the Kustomization that deploys
./kong, and its ExternalSecrets — but nothing watched dev/, so those files
were applied once by hand and never re-read. Editing them in git changed
nothing until someone remembered to kubectl apply, which is what silently
swallowed the CONTROL_PLANE_REF_NAME rollout: correct in git for hours
while the cluster still held the old value.

Add the bootstrap Kustomization that watches ./dev and, living in ./dev,
manages itself. This is what `flux bootstrap` would have created;
flux-operator installs the controllers and no root.

It sits in the domain namespace rather than flux-system, because sourceRef
resolves in the Kustomization's own namespace and because this is the
team's to own.

Needs one kubectl apply to exist. That is the last one this repo needs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 14:32:59 +02:00

34 lines
1.5 KiB
YAML

# The missing link. Everything else in dev/ — the GitRepository, the
# Kustomization that deploys ./kong, and the two ExternalSecrets — was applied
# once by hand and then never re-read, because nothing watched this directory.
# Editing flux-kustomization.yaml in git changed nothing in the cluster until
# someone remembered to kubectl apply it. That is what silently swallowed the
# CONTROL_PLANE_REF_NAME rollout: the value was correct in git for hours while
# the cluster still held the old one.
#
# This object watches ./dev, so those files reconcile like any other manifest.
# It lives in ./dev itself, so it also manages itself — the arrangement
# `flux bootstrap` sets up, and which flux-operator does not create.
#
# It sits in the customers namespace, not flux-system: sourceRef resolves in the
# Kustomization's own namespace, and this is the team's to own.
#
# Apply once with kubectl. That is the last manual apply this repo needs.
#
# 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 Kong configuration it manages. Correct GitOps behaviour, but the
# blast radius of removing one file is two levels deep.
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: customers-api-dev-bootstrap
namespace: customers
spec:
interval: 10m
sourceRef:
kind: GitRepository
name: customers-api-dev
path: ./dev
prune: true