-
Notifications
You must be signed in to change notification settings - Fork 1
feat(flux): complete cluster OCI migration #2161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,13 +9,26 @@ instance: | |
| - helm-controller | ||
| - notification-controller | ||
| sync: | ||
| kind: GitRepository | ||
| url: https://github.com/jfroy/flatops | ||
| ref: refs/heads/main | ||
| kind: OCIRepository | ||
| url: oci://ghcr.io/jfroy/flatops/cluster | ||
| ref: latest | ||
| path: kubernetes/cluster | ||
| interval: 1h | ||
| interval: 5m | ||
|
Comment on lines
11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No pull credentials are configured for the new source. GHCR packages are private on first push, and Either set the package to public (the artifact only contains manifests and Also note the signature verification is doing double duty here: with a public package,
Comment on lines
+12
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's the same anonymous path Please confirm
Comment on lines
11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After this lands there is no path into the cluster that doesn't go through Recovery becomes a manual |
||
| kustomize: | ||
| patches: | ||
| # Only reconcile cluster state from artifacts signed by this workflow on main. | ||
| - patch: |- | ||
| - op: add | ||
| path: /spec/verify | ||
| value: | ||
| provider: cosign | ||
| matchOIDCIdentity: | ||
| - issuer: ^https://token[.]actions[.]githubusercontent[.]com$ | ||
| subject: ^https://github[.]com/jfroy/flatops/[.]github/workflows/cluster-release[.]yaml@refs/heads/main$ | ||
| target: | ||
| group: source.toolkit.fluxcd.io | ||
| kind: OCIRepository | ||
| name: flux-system | ||
|
Comment on lines
+19
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving Worth confirming after rollout that the field actually landed: (and ideally asserting it in the release workflow or a VAP, since this is the only thing standing between a GHCR push and cluster-wide apply).
Comment on lines
+19
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This moves the cluster's only signature gate from a first-class manifest into a Kustomize patch, which fails open: Kustomize silently no-ops a patch whose Two things worth adding:
Comment on lines
+19
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth confirming this patch actually reaches the sync-generated The failure mode is unusually easy to miss here. The live Cheap check after the FluxInstance takes over:
Comment on lines
+19
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With So if the target ever stops matching (flux-operator changes the generated source's name, or someone later sets Two ways to make it fail closed, either is cheap:
Comment on lines
+20
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With
If either changes, the OCIRepository is still created and still Ready — just unverified, pulling whatever Worth pinning down before merge: # after the FluxInstance flips, confirm the patch actually landed and is owned by flux-operator
kubectl get ocirepository flux-system -n flux-system \
-o jsonpath='{.spec.verify}{"\n"}{range .metadata.managedFields[*]}{.manager}{" "}{end}{"\n"}'A VAP under |
||
| # Increase the number of reconciliations that can be performed in parallel | ||
| # https://fluxcd.io/flux/installation/configuration/vertical-scaling/#increase-the-number-of-workers-and-limits | ||
| - patch: | | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Cluster section is updated, but two things this PR changes are left undocumented, and both are exactly the kind of invariant an agent can't recover from the tree:
The
flux-systemOCIRepository is no longer a checked-in manifest. This PR deleteskubernetes/cluster/ocirepository.yaml, sogrep -rn 'kind: OCIRepository' kubernetes/cluster/now comes back empty while 176sourceRefentries point at it. It is generated byFluxInstance.spec.syncand its Cosignverifyblock exists only as a Kustomize patch inkubernetes/apps/flux-system/instance/ks/helm-values.yaml. Worth a sentence saying so, since the natural place to look for it no longer has it."Maintenance Commands" (line 33) is now wrong. It still says:
Committed Git state is no longer the precondition — Cluster Release has to publish and promote
latestfirst. Until it does,flux reconcile kustomization cluster-apps --with-sourcere-pulls the previous artifact and reads as a successful no-op, which is a genuinely misleading failure mode for anyone debugging "my commit didn't apply". Suggest rewording to "after the Cluster Release workflow has promoted the artifact" and addingflux reconcile source oci flux-system, since that is the source undercluster-appsnow.