Skip to content

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Dec 3, 2025

Summary

This PR updates the syncagent to the latest and greatest dependencies, mostly in order to get some important bugfixes from multicluster-provider. This means kcp 0.29 wasn't good enough, we actually needed the tip of everything. Mostly because of Kubernetes 1.33 vs 1.34.

Due to the significant changes in multicluster-provider, the agent also had to be adjusted quite a bit and the most significant change for endusers: --apiexport-ref had to be removed, so with this PR, the agent will only support APIExportEndpointSlices.

I tried to split the branch into easy to review commits and left some more details in the individual commits.

What Type of PR Is This?

/kind feature
/kind api-change

Related Issue(s)

Fixes #126

Release Notes

* Update dependencies to kcp 0.29, multicluster-runtime v0.22.4-beta.1 and multicluster-provider v0.3.2+e758bf0f4e48
* Remove `--apiexport-ref`, users must from now on provide an `APIExportEndpointSlice` name instead.

@kcp-ci-bot kcp-ci-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. labels Dec 3, 2025
@kcp-ci-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kcp-ci-bot kcp-ci-bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Dec 3, 2025
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from xrstf. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 3, 2025
@xrstf xrstf force-pushed the kcp-0.29 branch 2 times, most recently from d4336a7 to 36b3e38 Compare December 3, 2025 17:24
@xrstf
Copy link
Contributor Author

xrstf commented Dec 3, 2025

/test all

@kcp-ci-bot kcp-ci-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 11, 2025
@xrstf
Copy link
Contributor Author

xrstf commented Dec 12, 2025

/test all

Since the mcprovider now watches the APIExportEndpointSlice itself, it does not make sense anymore
to start it dynamically on demand. There is no point in having the syncmanager watch an APIExport or
EndpointSlice itself, since the mcprovider does not take any URLs as input values anymore, it relies
solely on watching the EndpointSlice itself.

To accomodate this, I moved the manager and its provider up into the main(). Since the syncmanager
controller however not just simply starts an mcmanager/provider, but also deals with dynamically
started controllers, I decided to move that behaviour into a new DynamicMultiClusterManager (DMCM).

The DMCM is capable of keeping track of all engaged clusters and allows you to add and start
controllers at any time. It will automatically pre-seed new controller instances with the known
clusters.

There is one downside: Right now, if the controller fails to start, the syncmanager controller will
not notice, re-reconcile and restore it. There's no back channel for that error from the sync
controller's goroutine yet.

---

Since the syncagent by design dynamically fills APIExports with resource schemas, when the DMCM is
started, there are most likely (at least in cold start situations) no resource schemas yet in the
APIExport. Even though the syncmanager waits for the apiresourceschema controller to be done, it
currently does not wait for the apiexport controller to be done (in adding that ResourceSchema to
the APIExport) (there is no condition or anything to tell when that controller has finished).

This means the syncmanager will start new sync controllers at the same time as the apiexport
controller is still filling the APIExport. However when the resources are not present yet, these
sync controllers fail to boot up, and since there is currently no channel to report this back to the
syncmanager, they do not get quickly restarted.

To handle this (it might have been simpler to wait for the APIExport to be ready, but alas... I
realized my oversight too late), I added an explicit API discovery step, where the sync controllers
are only started if and when the primary resource is actually available.

---

One major side effect of this whole refactoring is of course: the agent does not longer support
watching APIExports for their deprecated virtual workspace URLs. When this is merged, you must
provide an APIExportEndpointSlice.

On-behalf-of: @SAP [email protected]
@xrstf
Copy link
Contributor Author

xrstf commented Dec 12, 2025

/test all

@xrstf
Copy link
Contributor Author

xrstf commented Dec 12, 2025

/kind feature
/kind api-change

@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 12, 2025
@kcp-ci-bot kcp-ci-bot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Dec 12, 2025
@xrstf xrstf changed the title Kcp 0.29 Update dependencies to kcp 0.29 Dec 12, 2025
@xrstf xrstf marked this pull request as ready for review December 12, 2025 17:32
@kcp-ci-bot kcp-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 12, 2025
@xrstf xrstf changed the title Update dependencies to kcp 0.29 Update dependencies to kcp 0.29, Kube 1.34 Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: api-syncagent generates thousands of http 404 request

3 participants